Reputation: 3582
the code is:
console.log("\1" === "\u0001");//true
console.log("\01" === "\x01");//true
console.log("\001" === "\u0001");//true
why "\001" === "\u0001"
is true,who can tell me why?
Upvotes: 1
Views: 5257
Reputation: 887807
All of those strings are a single character; namely, Unicode code point 1.
Those are different ways of escaping it in the string literal.
Upvotes: 5