I tried to do the same challenge.
SOLUTION REDACTED
this passed the test, if not working Reset all code and replace the code in the input box with your code
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
I appreciate your efforts in making forums a better place for us. I saw he already solved the problem but there is a bug in the built-in editor, I just wanted to share code for him to make sure it’s not that his code is wrong.
Those types of things can occur in the future as well, I recommend you to use vscode or any type of text editor along with freeCodeCamp’s built-in editor as challenges grow more complex it would be much easier for you to edit your code and also when this type of things happens you just don’t rely on your clipboard.
I agree that learning a code editor is helpful in the long run, but I don’t think OP’S problem had anything to do with an editor whatsoever. It was just a misunderstanding of the directions, which happens to all of us from time to time.
I tried your code in an online compiler for me it gives your required output without a problem. But you can also try the below method to for strings without using / symbols all over your string.
type or paste code here
var myStr = `I am a "double quoted" string inside "double quotes".`;
console.log(myStr);
Also in modern javascript developers doesn’t use var for declaring variables. Instead of var developers use let and const for declare variables.
type or paste code here
const myStr = `I am a "double quoted" string inside "double quotes".`;
console.log(myStr);
Hey isuru! Thank you for your time. Yes indeed I am aware of modern js standards and the scoping issues that var has. I was just trying to solve the challenge at the time. Thank you so much for your help!
Happy Coding
The challenge specifically asks the user to use escaped double quotes. If you are unsure of the requirements of challenges the users are completing, typically there is a link you can click and read in the first post.