Tag Info

New answers tagged

7

The first difference can be summarized as: this refers to the Instance of the class. prototype refers to Definition. Let's say we have the following class: var Flight = function ( number ) { this.number = number; }; So here we are attaching this.number to every instance of the class, and it makes sense because every Flight should have their own flight ...



Top 50 recent answers are included