引号
1. 单引号和双引号
let singleQuoteString = 'Hello, World!';
let doubleQuoteString = "Hello, World!";
// 如果需要在字符串中包含引号
let quoteInSingle = 'She said, "Hello"';
let quoteInDouble = "It's a sunny day";2. 反引号(模板字符串)
let name = "Alice";
let templateString = `Hello, ${name}!`; // 输出 "Hello, Alice!"
// 多行字符串
let multiLineString = `This is a
multi-line
string.`;
console.log(multiLineString);三对双引号
Last updated