-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.
Description
Version: v7.9.0
Platform: Darwin green.local 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
so i have this in a file
console.log('hello')
const a = 2
[3,4].forEach(n => console.log(n))
and when doing node weird.js i get
[3,4].forEach(n => console.log(n))
^
TypeError: Cannot read property 'forEach' of undefined
at Object.<anonymous> (/Users/pvinis/Desktop/weird.js:3:6)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3
also https://es6console.com/j2uho344/ this might be helpful.
i saw that Array(3,4).forEach.. works fine.
is that a bug? is that on purpose like that?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.