// 引号转义 var quote = "He read /"The Cremation of Sam McGee/" by R.W. Service."; // 转义反斜线 var home = "c://temp"; // 转义换行 一条语句拆成多行书写 var str = "this string / is broken / across multiple/ lines." console.log(str); // this string is broken across multiplelines. // Javascript没有“heredoc”语法,但可以用行末的换行符转义和转义的换行来近似实现 var poem = "Roses are red,/n/ Violets are blue./n/ I'm schizophrenic,/n/ And so am I."
您可能感兴趣的文章: