Skip to content Skip to sidebar Skip to footer

Difference In Interpretation Between Firefox And Node.js

I have come across an anomaly between Firefox and Node.js. Given the following code: 'use strict'; const obj = {}; for (let f of ['left', 'right']) { obj[f] = function() { re

Solution 1:

Your version of Node is correct here, let in a for loop should have block scope.

FF 48 simply doesn't support "for/for-in loop iteration scope" yet, it appears to be fixed with FF 51.

Post a Comment for "Difference In Interpretation Between Firefox And Node.js"