Iterate over String.prototype
问题 I am aware that the for in loop can help iterate through properties of objects, prototypes and collections. The fact is, I need to iterate over String.prototype , and though console.log(String.prototype) displays the complete prototype, when I do for (var prop in String.prototype) { console.log(prop); } to display the name of the elements in the prototype, it displays nothing, as if it were empty. Do the JavaScript engines hide the basic prototypes methods, or am I doing something wrong? 回答1: