Search Results

Search found 2 results on 1 pages for 'tarek11011'.

Page 1/1 | 1 

  • in javascript whay use " var that = this "

    - by tarek11011
    hi i am new with javascript What is the benefit of using this line var that = this An example function Person( firstname, lastname, age ) { this.firstname = firstname; this.lastname = lastname; this.age = age; getfullname = function() { return firstname + “ “ + lastname; }; var that = this; this.sayHi = function() { document.write( “Hi my name is “ + getfullname() + “ and I am “ + that.age + “years old.”); }; } thanks

    Read the article

  • in javascript why use " var that = this "

    - by tarek11011
    hi i am new with javascript What is the benefit of using this line var that = this An example function Person( firstname, lastname, age ) { this.firstname = firstname; this.lastname = lastname; this.age = age; getfullname = function() { return firstname + “ “ + lastname; }; var that = this; this.sayHi = function() { document.write( “Hi my name is “ + getfullname() + “ and I am “ + that.age + “years old.”); }; } thanks

    Read the article

1