-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
This example from the MDN site is not working in Node 4.2.2:
var myMap = new Map();
myMap.set(0, "zero");
myMap.set(1, "one");
for (var [key, value] of myMap) {
console.log(key + " = " + value);
}
// Will show 2 logs; first with "0 = zero" and second with "1 = one"When I run this, I get:
/home/jeff/foo.js:4
for (var [key, value] of myMap) {
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Thanks!
Metadata
Metadata
Assignees
Labels
v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.