How does js reverse escape the slash?

clipboard.png

C:\ Program Files\ Git

for example, in this path, there is no slash after assignment.

how to solve this problem without adding\?

in addition, I tried to enter this string in input, and then listened to the blur event. When I lost focus, I assigned value to a variable. At this time, the value of this variable is correct. Why?

Jun.19,2022

is that what you mean?
clipboard.png


let str = 'C:\\Program Files\\Git'

you have to add it. You can wrap it in three dots and display it because you treat it as text

.
Menu