{code:php}
var aString = 'this is a string with a // in it '.'and a concatenation';
{code}
The syntax highlighter is treating the // in the string as a comment start, but only until the end of the string. This results in everything between the // and the next ' character to be formatted grey as a comment, which is incorrect.
Question is old but writing for reference that may be helpful.
The syntax error regarding comment start may have been caused by another syntax error. I have tried this in Netbeans IDE and didn't get any syntax error:
const aString = 'this is a string with a // in it '.'and a concatenation';
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.