标签:text hello color 复杂 use cap es6 引号 div
console.log("double"); vs console.log(‘single‘); 不应该以编码风格为重点, 而应该以引号内的内容为重点, 比如以下 alert(‘Say "Hello"‘); alert("Say ‘Hello‘"); 更复杂的 alert("It‘s \"game\" time."); alert(‘It\‘s "game" time.‘); ES6更喜欢用反斜杠 alert(`Use "double" and ‘single‘ quotes in the same string`); alert(`The escape the \` back-tick character in a string`); 比如 `\`` === "`" // --> true console.log("string text line 1\n"+ "string text line 2"); // "string text line 1 // string text line 2"
标签:text hello color 复杂 use cap es6 引号 div
原文地址:http://www.cnblogs.com/funnyweb/p/6197089.html