Reputation: 350
I am creating a simple string but all my letters after backslashes are being interpretted as special tags. Example:
const string = "C:\Users"
console.log(string)
The \U
doesnt get printed in the final string so the console output looks like this: C:sers
. How would I go about fixing this?
Upvotes: 0
Views: 30
Reputation: 3965
You can escape these characters by adding an extra \
const path = "C:\\users";
console.log(path)
Upvotes: 1