E0089: with statement needs parentheses around expression
with
statements have an expression after the with
keyword. It is a syntax
error to write an expression without (
and )
:
with person {
console.log(`Hi, ${firstName} ${lastName}!`);
}
To fix this error, write (
before the expression and )
after the expression:
with (person) {
console.log(`Hi, ${firstName} ${lastName}!`);
}