var i = 'Hello \n World'
console.log(i)
/*
Output:
Hello
World
*/
/*
Desired output: Hello \n world
*/
var j = 'javscr\u0012ipt'
console.log(j)
/*
Output:
javscr ipt
*/
/*
Desired output: javscr\u0012ipt
*/
Above code shows what output I am supposed to get when i have a special character in the string, what output I want. I don't want the special character whether it is line break or unicode to get rendered on screen and rather they should be a part of string. Can anyone tell me how can I achieve this. Any help will be appreciated ( I am using angularjs as framework) .