Function prototype: Difference between revisions

Line 312:
 
=={{header|JavaScript}}==
=== ES5 ===
ES5: JavaScript functions may also be used to define prototype objects
<lang JavaScript>
// A prototype declaration for a function that does not require arguments
Line 331 ⟶ 332:
l.pop(); // 5
l.length; // 0
 
 
 
// A prototype declaration for a function that utilizes varargs
Line 355 ⟶ 354:
</lang>
 
=== ES6 ===
ES6: Class Declarations are used to define prototype objects
<lang JavaScript>
// A prototype declaration for a function that does not require arguments
Anonymous user