Home  >  Article  >  Web Front-end  >  Javascript valueOf usage_basic knowledge

Javascript valueOf usage_basic knowledge

WBOY
WBOYOriginal
2016-05-16 18:57:06851browse

object.valueOf( )
Required The object parameter is any native JScript object.
Explanation
The valueOf method definition of each JScript intrinsic object is different.

对象 返回值
Array 数组的元素被转换为字符串,这些字符串由逗号分隔,连接在一起。其操作与 Array.toStringArray.join 方法相同。
Boolean Boolean 值。
Date 存储的时间是从 1970 年 1 月 1 日午夜开始计的毫秒数 UTC。
Function 函数本身。
Number 数字值。
Object 对象本身。这是默认情况。
String 字符串值。
Math and Error objects do not have a valueOf method.

Applies to:
Array object | Boolean object | Date object | Function object |Number object | Object object | String object
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn