Variable declaration reset: Difference between revisions

m
→‎{{header|JavaScript}}: init remark, added "Any of 1) / 2) / 3)"
(→‎{{header|JavaScript}}: added "for(i=0, prev;" alternative)
m (→‎{{header|JavaScript}}: init remark, added "Any of 1) / 2) / 3)")
Line 289:
</html></lang>
No output<br>
ManuallyAny of 1) manually moving the declaration of prev to before the loop, or 2) using <code>for (let i=0, prev; i<7; i+=1)</code>, and in fact initialising prev there, to any value, works exactly the same, or 3) changing the third "let" to "var" (causes legacy hoisting and) gives:
{{out}}
<pre>
7,796

edits