JavaScript语言参考 valueOf 方法 (String)
返回字符串 语法 string.valueOf() 参数 此方法没有参数。 返回值 返回字符串值 备注 在下面的示例中,字符串对象与返回值相同。 var str = "every good boy does fine"; var strStr = str.valueOf(); if (str === strStr) document.write("same"); else document.write("different"); // Output: // same 必备条件 在以下文档模式中受支持:怪异模式、Internet Explorer 6标准模式、Internet Explorer 7标准模式、Internet Explorer 8标准模式、Internet Explorer 9标准模式、Internet Explorer 10标准模式、Internet Explorer 11标