Think about how you define a string in JS: you wrap it in quotation marks.
So in the above, JS is going to read that code as
// start of string
"I am a "
// end of string
// syntax error, string has ended
double quoted
// and if JS could continue:
// start of another string
" string inside "
// end of string
// syntax error
double quotes
// start of string
"."
// end of string
JS can’t tell that the double quote marks inside the string are meant to be actual quotation marks rather than start/end of strings unless you tell it that by escaping them.
At the minute, to the the JS parser, it looks like there are three strings with some gibberish inbetween.