This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
notes:javascript_cheat_sheet [2026/07/30 15:06] 2.51.24.69 old revision restored (2026/06/04 17:16) |
notes:javascript_cheat_sheet [2026/07/31 14:34] (current) 101.47.19.212 old revision restored (2026/06/04 14:43) |
||
|---|---|---|---|
| Line 71: | Line 71: | ||
| personObj.newfirstname = | personObj.newfirstname = | ||
| | | ||
| - | { this.lastname=new_lastname; } </ | + | { this.firstname=new_firstname; } </ |
| * Objects can be created using a template <code javascript> | * Objects can be created using a template <code javascript> | ||
| function person(firstname) { | function person(firstname) { | ||
| Line 77: | Line 77: | ||
| this.newfirstname = | this.newfirstname = | ||
| function (new_firstname) | function (new_firstname) | ||
| - | { this.lastname=new_lastname; } | + | { this.firstname=new_firstname; } |
| } | } | ||
| myFather=new person(" | myFather=new person(" | ||
| Line 88: | Line 88: | ||
| function newfirstname(new_firstname) | function newfirstname(new_firstname) | ||
| { this.firstname=new_firstname; | { this.firstname=new_firstname; | ||
| + | |||
| ==== Predefined Objects ==== | ==== Predefined Objects ==== | ||
| * String objects have a length property and methods including: indexOf, match, replace | * String objects have a length property and methods including: indexOf, match, replace | ||