christianalfoni / webpack-bin

A webpack code sandbox
http://www.webpackbin.com
MIT License
710 stars 75 forks source link

Parent scope of const not accessible in forEach statement #211

Open motleydev opened 7 years ago

motleydev commented 7 years ago

Works:

var rotate = d3.scaleLinear().domain(d3.extent(days)).range([0, 2*Math.PI])

days.forEach(d => {
  const v = rotate(d)
  bin.log(v)
})

doesn't work:

const rotate = d3.scaleLinear().domain(d3.extent(days)).range([0, 2*Math.PI])

days.forEach(d => {
  const v = rotate(d)
  bin.log(v)
})