I know that a for in
loop can help iterate over the properties of objects, prototypes, and collections.
The thing is, I need to String.prototype
over String.prototype
, and although console.log(String.prototype)
displays the full prototype when I do
for (var prop in String.prototype) { console.log(prop); }
in order to display the name of the elements in the prototype, it does not display anything, as if it were empty.
JavaScript utilities hide basic prototype methods, or am I doing something wrong?
source share