Skip to content

@babel/parser: when I use parseExpression to parse code, I get some errors. #15045

Answered by nicolo-ribaudo
Losstie asked this question in Q&A
Discussion options

You must be logged in to vote

An expression is something that would be valid when wrapped in (...). For example, 1 + 2 is an expression because (1 + 2) is valid code. const a = 1 isn't an expression, because (const a = 1) is not valid JavaScript.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Losstie
Comment options

Answer selected by JLHwung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants