freecodecamp.cn icon indicating copy to clipboard operation
freecodecamp.cn copied to clipboard

Escape Sequences In Strings has a bug

Open uptaincolin opened this issue 9 years ago • 5 comments

Challenge Escape Sequences in Strings has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

var myStr=" \\  \t \b \r \n"; // Change this line



uptaincolin avatar Mar 28 '17 06:03 uptaincolin

你写太多空格了,这题并没有bug

var myStr = "\\ \t \b \r \n";

wudifeixue avatar Mar 28 '17 19:03 wudifeixue

我不明白这道题 到底是 按照字符串来写 还是按照转义后的像这样 var myStr = "\ \t \b \r \n";

visibleLi avatar Apr 28 '17 04:04 visibleLi

@visibleLi 试试就知道。由于 \ 本身就是转义标识符,因此要显示 \ 就需要写成 \\。只写一个 \ 是不行的,因为会当成转义标识符来处理。 类似的问题请到 gitter 提问

S1ngS1ng avatar Apr 28 '17 14:04 S1ngS1ng

我发现这个有什么会延迟

H29 avatar May 17 '17 10:05 H29

@wudifeixue 有Bug吧 不然为什么这一行不能加注释

kzone0520 avatar Jun 03 '18 16:06 kzone0520