Concatenating Strings with the Plus Equals Operator doesn't work
Challenge Concatenating Strings with the Plus Equals Operator has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var myStr = "This is the first sentence.";
myStr+=" This is the second sentence.";
When the example code is removed, the test fails even if the solution is correct:
// Example
var ourStr = "I come first. ";
ourStr += "I come second.";
If you Reset and then enter the solution directly below // Only change code below this line, it will pass.
This makes me wonder why the example code isn't just in the description sidebar since it has no practical purpose in the editor.
Okay my bad. Sorry for the trouble did not read the instructions properly.
i am on the same challenge right now and it did exactly as jamigibbs wrote but before i came looking for help and yes it still does not pass the part for the mystr+= will but the upper one for the var myster does not pass is thier a bug in it this is how it looks
// Example var ourStr = "I come first. "; ourStr += "I come second.";
// Only change code below this line
var myStr = "This is the first sentence. "; mystr +="This is the second sentence."; bottom myster += passes but top no matter how i changed it will not pass and i dont understand what im doing wrong
removed solution by mod
JavaScript Operators
The assignment operator += can concatenate strings.