Here is my code.
`var myStr = “This is the first sentence. “
myStr += “ This is the second sentence.”;`
And the error message
>
Error: SyntaxError: unknown: Unexpected character ‘“’ (7:12) (/index.js:1)
Here is my code.
`var myStr = “This is the first sentence. “
myStr += “ This is the second sentence.”;`
And the error message
>
Error: SyntaxError: unknown: Unexpected character ‘“’ (7:12) (/index.js:1)
try single quotes instead of double quotes.
it should have worked for either but not sure why doesnt work now
Right. Single quotes is also not working on Scrimba, which the instructor on youtube is also using.
ok i see the problem. you probably just copy pasted the code rather than type it out.
the quotes arent actual quotes so just retype them manually and that should work with either single or double.
theres nothing actually wrong with yout syntax
You’re right. I cut and pasted. Typing did not fix the error. Here it is on this try:
>
Error: SyntaxError: unknown: Unexpected character ‘“’ (7:12) (/index.js:1)
var myStr = "This is the first sentence. "
myStr += " This is the second sentence.";
copy and paste that
Here’s the error. Odd.
>
Error: SyntaxError: unknown: Unexpected character ‘“’ (7:12) (/index.js:1)
Are you on some mobile device or tablet?
@alkapwn3d btw, you have a space that shouldn’t be there.
myStr += "This is the second sentence.";
thats how OP originally had it.
also spaces counts as characters so its fine
The code you posted and which you said the OP should copy and paste will fail the first test of the challenge.
OP never posted the challenge. she posted an error message
Try following the advice of turning off smart punctuation. You are using “”
, which is a character non accepted in coding, you should be using ""