Node reported an Unexpected end of input.

  node.js, question

图片描述

图片描述

Why does my code still report errors when there is no semicolon?

First of all, a good Javascript habit is to add a bonus mark to the end of a sentence, and the parser will also add it for you if you don’t add a bonus mark (only the semicolon added by the parser, who knows how it will end up! ! ! )。 Second, it doesn’t matter if you don’t have a semicolon. This is a lexical error, it must be something like where the brackets do not match.