Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
notes:javascript_cheat_sheet [2008/09/06 23:53] smthng |
notes:javascript_cheat_sheet [2008/09/07 02:39] (current) smthng |
||
---|---|---|---|
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 |