25
loading...
This website collects cookies to deliver better user experience
[]
length: 0
__proto__: Array(0) // <--- Here it is!
length: 0
constructor: ƒ Array()
concat: ƒ concat()
let example = [1,2,3,4,5]
example
(5) [1, 2, 3, 4, 5]
0: 1
1: 2
2: 3
3: 4
4: 5
length: 5
__proto__: Array(0) <-- woah! There it is again!
Object.prototype
{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …}
Array.prototype.phrase = () => console.log("I like math")
(5) [1, 2, 3, 4, 5]
0: 1
1: 2
2: 3
3: 4
4: 5
length: 5
__proto__: Array(0)
phrase: () => console.log("I like math") <--- Magic.
example.phrase() // "I love math"