JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

6.10.4 The valueOf() Method

6.10.4 The valueOf() Method


The valueOf() method is much like the toString() method, but it is called when Java-Script needs to convert an object to some primitive type other than a string—typically, a number. JavaScript calls this method automatically if an object is used in a context where a primitive value is required. The default valueOf() method does nothing interesting, but some of the built-in classes define their own valueOf() method (see Date.valueOf(), for example). §9.6.3 explains how to define a valueOf() method for custom object types you define.

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/31347.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1