I found that both the Array
Object and Array.prototype
have the length
property. I am confused on using the Array.length
Array.length
is how many arguments the function Array()
takes and Array.prototype.length
is an instance method that gives you the length of your array. When you check ['foo'].length
you're actually checking Array.prototype.length
with the this
argument being your array ['foo']
var myArray = ['a','b','c']
console.log(myArray.length); //logs 3