ES6 toString()

此方法返回表示指定对象的字符串。

语法

string.toString()

返回值

返回表示指定对象的字符串。

var str = "Apples are round, and Apples are Juicy.";
console.log(str.toString( ));

输出

Apples are round, and Apples are Juicy.

此方法返回转换为大写的调用字符串值。语法string.toUpperCase()返回值返回表示指定对象的字符串。例var str = "Apples are round, and Apples are J ...