Reputation: 1263
I came across this today, and just want to get more on why and how [].values
is a function
$ node -e 'console.log([].values)'
[Function: values]
Upvotes: 0
Views: 89
Reputation: 664589
Array.prototype.values
is a function that your empty array inherits. It's usually called as a method and returns an iterator.
Upvotes: 2