How to decipher these words in js code

\u0422\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u044F 

    2 answers 2

     var string = '\u0422\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u044F'; console.log(unescape(string)); //Территория 
    • Well, and if in the code it is a lot of? There are utilities to bring it into a human form - Vlmake
    • Well, for example, ddecode.com/phpdecoder - VenZell
    • @Vlmake vim, for example: s, \\ u (\ x \ +), \ = nr2char ("0x" .submatch (1)), g This word - "Territory" - alexlz

    2019

    Because unescape is obsolete, use decodeURI or decodeURIComponent instead.

    Source: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/unescape

     console.log( decodeURI('\u0422\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u044F') ) 

    • Does it bother you that console.log('\u0422\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u044F') also works excellently? - andreymal
    • @andreymal, that is, JS itself always leads such a line to the normal form if there \u ? I just saw the unescape unescape , but it is outdated. - Ilya Zelenko