Has anyone read "JavaScript, The Definitive Guide" (O'Reilly)?
I spent several hours digesting Example 9-7.
In particular, the .foreach() "class" method has me somewhat puzzled.
Also, does .valueOf get called automatically?
Thank you in advance.
Has anyone read "JavaScript, The Definitive Guide" (O'Reilly)?
I spent several hours digesting Example 9-7.
In particular, the .foreach() "class" method has me somewhat puzzled.
Also, does .valueOf get called automatically?
Thank you in advance.
valueOfandtoStringare called "automatically".valueOfif the object i question is converted to a number, andtoString, well, if it is converted to a string.But if you would have read the book, you should know that already.
Why? It is a member of
Array.prototype, well documented and extremly handy. Or do you refering to another example?