Array, Array.prototype JavaScript .
:
function MyClass() {
this.foo = Math.random();
}
MyClass.prototype.getFoo = function() {
return this.foo;
}
var bar = new MyClass();
console.log(bar.getFoo());
( ) . . (getFoo), .
, , . length , :
[1, 2, 3, 4].length == 4;
, , Array . , Array.length, , Array (). length.
source
share