javascript - How can I map a prototype function to an array of objects that have that prototype? -


is there way in javascript handle on object prototype function guaranteed object in question? particularly got pita situation when wanted map array of objects of proper type such function. ended being window. yes did pull function proper place internally refers 'this'. know call , apply not how might use them handle sort of situation.

is there way short of explicit loop instead of using map? oddly apparently not same thing re 'this'

object_with_the_prototype.some_prototype_function()  

would if instead have

[object_with_the_prototype].map(this.some_prototype_function) 

how come?

i think looking this:

[object_with_the_prototype].map(function(thisobject) {     thisobject.some_prototype_function(); } ); 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -