标签:code hello develop href 数学运算 evo ISE script 有一个
以下内容为学习记录,可以参考 MDN 原文。
字符串,即我们通常所说的文本。
let string = ‘The revolution will not be televised.‘;
字符串可以使用单引号或者双引号包裹起来,但是必须成对。
在字符串中,可以使用 \ 来转义字符。
let bigmouth = ‘I\‘ve got no right to take my place...‘;
在 JavaScript 中连接字符串使用加号(+)操作符
let one = ‘Hello, ‘;
let two = ‘how are you?‘;
let joined = one + two;
console.log(joined);
输出内容为:Hello, how are you?
let myDate = ‘19‘ + ‘67‘;
console.log(myDate);
console.log(typeof myDate);
console.log(Number(myDate));
console.log(typeof Number(myDate));
console.log(typeof Number(myDate).toString());
标签:code hello develop href 数学运算 evo ISE script 有一个
原文地址:https://www.cnblogs.com/jiangbo44/p/13258068.html