I'm studying the difference between Object.method and Object.prototype.method. I know I should use Object.keys() as following.
var arr = new Array(1,2,3);
console.log(Object.keys(arr)); //["0", "1", "2"]
and Object.prototype.toString() as following
var arr = new Array(1,2,3);
arr.toString(); // "1,2,3"
console.log(arr.keys(arr));
I get
Array Iterator {}
at a console. Why? Shouldn't it be denied in the first place? (Since .keys() method is in Object object itself not in Object.prototype that maybe means arr cannot approach to the .keys() method?) What am I missing?