My current node version is 12.22.6.
I'm struggling to understand why this code isn't working correctly.
It seems like I must be missing an important basic concept, but I can't quite pinpoint it.
const changeVars = (variable) => {
console.log(variable + " is a " + typeof(variable) + "\n");
}
const myVariables = [
42,
"42",
{number: 42},
{},
true,
undefined
]
myVariables.forEach(variable => changeVars(variable));
node vars.js
$ SyntaxError: Unexpected token 'var'