How to fix the coad ? HINT: escape single quote in between string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to fix the coad ? HINT: escape single quote in between string

https://code.sololearn.com/c2AUIut47C5d/?ref=app

29th Oct 2021, 8:34 AM
Jenjirala Vijay
Jenjirala Vijay - avatar
12 Answers
+ 4
#1—2 ☺️ console.log( ' I\'m learning "JavaScript" ' );
29th Oct 2021, 8:52 AM
Solo
Solo - avatar
+ 3
Jenjirala Vijay In response to code from Vasiliy Did you remove #2 from the code. I ran it without a problem. Also, the code he showed you is an easy way to avoid having to use the escape character, and it makes the code easier to read. That's why he showed that option. We both understand that you needed the escape character \ for the answer in your first code
29th Oct 2021, 9:01 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
console.log('I\'m learning JavaScript'); I hope this is not homework
29th Oct 2021, 8:40 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Jenjirala Vijay Thanks for your honesty. 😁👍 I hope the answer given helps you
29th Oct 2021, 8:47 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
jenjirala vijay means badly tried
29th Oct 2021, 9:02 AM
Solo
Solo - avatar
+ 2
It would be helpful to show exactly what you have tried (we can't see it from your code) And remember that you can always go back and review the previous lessons of the course
29th Oct 2021, 9:18 AM
Lisa
Lisa - avatar
+ 2
Either you can simply close the string in double quotes or you can use \ before single quotation like :- 'I\'m learning JavaScript');
30th Oct 2021, 3:42 AM
Neeraj Kumar
Neeraj Kumar - avatar
+ 1
This is a practice problem but I have tried lot time but I didn't get answers that's why I post this
29th Oct 2021, 8:42 AM
Jenjirala Vijay
Jenjirala Vijay - avatar
+ 1
Yes 😄😄
29th Oct 2021, 8:49 AM
Jenjirala Vijay
Jenjirala Vijay - avatar
+ 1
I have tried vasiliy but syntax error shown😢😢
29th Oct 2021, 8:56 AM
Jenjirala Vijay
Jenjirala Vijay - avatar
0
And also Escape the single quote inside the string.
29th Oct 2021, 8:54 AM
Jenjirala Vijay
Jenjirala Vijay - avatar
- 1
Zuxx
31st Oct 2021, 4:55 AM
Alexander Ruppel
Alexander Ruppel - avatar