100 doors: Difference between revisions

Javascript →‎ES6: Flagged example as working with SpiderMonkey after changing the console.log call to work with SpiderMonkey
imported>Lacika7
mNo edit summary
(Javascript →‎ES6: Flagged example as working with SpiderMonkey after changing the console.log call to work with SpiderMonkey)
Line 7,444:
 
 
{{works with|SpiderMonkey}}
<syntaxhighlight lang="javascript">// Array comprehension style
[ for (i of Array.apply(null, { length: 100 })) i ].forEach((_, i) => {
Line 7,450 ⟶ 7,451:
 
if (sqrt === (sqrt | 0)) {
console.log("Door %d" + door + " is open", door);
}
});</syntaxhighlight>
3,044

edits