- 2
Please I need help on using the js excape character
Except character \
7 Réponses
+ 4
You need to escape the ' in I'm to make it work: put the \ before '
+ 2
Can you give an example how you want to use it?
You only need to write it in front of the to-be-escaped character:
console.log(" \" ");
+ 2
You can use single quotes as well, that doesn't matter
0
Thanks for responding
Using single quote
0
Something like this is given
console. log('I'm a javascript programmer')
Then I am ask to escape with backslash (\)
And the expected result is,
I'm a javascript programmer
I HAVE TRIED DIFFERENT METHODS AND IS NOT WORKING.
PLEASE HELP
0
You write the escape sequence just before the charcacter that you want to escape. For example...
\' would be read as simply ' by the compiler.
So you should write
console.log('I\'m a javascript programmer');
0
Or you could also use combination of quotes...
console.log("I'm a javascript programmer");
Then there is no problem.🙂