why doesn’t this work for me ;-;-;-;

var myStr = "I am a\"double quoted\" string inside \"double quotes\"";


You need to wrap your code in triple backticks so we can see it properly.

Also, be sure to include a link to the challenge so we don’t have to search around for it.

  • You’re missing a space between a and the first double quote.
  • There should be a period at the end of the sentence.
hey you have missing the space between (a\" => a \" )and also at the end of statement there missing period between the ".".
try it ..

No clue what dat means ;-;

doesn’t work
(a" => a " )

your code is technically correct and works in a java compiler.
however, these java camp mini tests are extremely specific.
If the lesson shows that you should create the string as a ‘const’ and you created a ‘var’ (constant versus variable) it gives you an x in correct answer. There is a free java platform (PlayCode - Javascript Playground) that I have been playing with and most of my answers are technically ‘correct’, but when they show as x incorrect, I usually did not follow specific instructions. Like declaring a constant string (const) instead of a variable string (var.) Or changing the name of a variable they want me to name.

1 Like

I would not call this answer ‘technically correct’. Code running does not mean that it is producing correct, meaningful results. In programming, the small details have huge importance.

In this case, the string will look confusing if you console.log it, as there are missing spaces.

For example, these two words are jammed together with no space between them.

Side note: Java and Javascript are very, very different

1 Like

ive tryed a lot , and a long time but it didn’t work bruv

ive tryed to make the spaces bigger and stuff , it did not work :confused:

Where is a version of your code where you added spaces? We can’t help you fix changes you don’t share.

you missed a period to end sentence. This line works. Copy and paste.
Again, both your code and this code work, but assignment asks for a period.


No, that line is not just missing a period. There is also a space missing between two of the words.

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.

My thoughts are…this person is learning how to code from scratch. His coding does work and he needs to know that. If he was in using a real development platform, he would see that his code works, and then he can double check the output to ensure the sentence is exactly the way it should be. I think many people can get frustrated using freeCodeCamp and give up java if they don’t understand that their coding does work, but it doesn’t match the required output (hence, the space before the quotes and the period at end of sentence.) Early on in this program, if the lessons focused on ‘coding’ and not ‘exact output’, the frustration level would decrease.

Computers are stupid. They need exactly correct syntax. Telling someone that their code is correct when it’s wrong is just confusing. Code that ‘works’ but produces a wrong result simply does not work.


You can see in the logs below what your string is being evaluated to.

Here’s what you’ve got:

myStr = "I am a"double quoted" string inside "double quotes""

Here’s what’s expected:

myStr = "I am a "double quoted" string inside "double quotes"."

Here’s a program that compares texts for you:

Hope that helps!

1 Like

Welcome there,

I’ve changed your thread title to describe your problem more clearly. Descriptive titles, such as “Why does my function return undefined?”, are more likely to elicit helpful responses than titles, such as “heLP ME IM DYING”.

We recommend familiarising yourself with how to ask a question on this forum. Specifically, you are more likely to get useful help, if you provide a helpful title and description:

lmfao i know whats the problem now , i forgot to put a period behind my sentence XD