0

Below code,

document.writeln("Caracteres escapados {\u55e8\uff0c\u4f60\u597d\u5417}: "
                                                    + "\u55e8\uff0c\u4f60\u597d\u5417");

expected output is \u55e8\uff0c\u4f60\u597d\u5417: 嗨,你好吗

Current output is: Caracteres escapados {嗨,你好吗}: 嗨,你好吗

What modification is required in the above code?

2 Answers 2

1

You need to escape your backslashes and remove the braces.

document.writeln("Caracteres escapados \\u55e8\\uff0c\\u4f60\\u597d\\u5417 "
                                                    + "\u55e8\uff0c\u4f60\u597d\u5417");
Sign up to request clarification or add additional context in comments.

Comments

1

Just escape the backslashes of the codes you want to show without translating:

document.writeln("Carácteres escapados \\u55e8\\uff0c\\u4f60\\u597d\\u5417: \u55e8\uff0c\u4f60\u597d\u5417");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.