It might be a stupid question, but why do I get an empty array when I console out Array.prototype ?
I was expecting the push and pop methods.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most of the built-in methods of prototypes are not enumerble, so they won’t show up if you use
for..in(which you shouldn’t on arrays, but this is just an example). Since they not enumerable, they won’t show up if you “console them out”.