javascript - Chrome is unable to do array destructuring -
i have following function:
function evaluatescroll(positions, width){ var scale = width / (width - math.abs(positions[0]) - math.abs(positions[1])); var startlocation = positions[0] / width; return [scale, startlocation]; }
and use in following way:
[tscale, tstartlocation] = evaluatescroll(scrollpositions, scrollplotwidth);
in safari , firefox, works expected work. in chrome, however, code hangs-up @ line.
changing to:
var holder = evaluatescroll(scrollpositions, scrollplotwidth);
works, have parse out indexes of holder
appropriate variables.
how come chrome won't work array-style assignment? there syntax can implement work across browsers, without having holder variable , reassigning appropriate ones?
it appears chrome 48 (current stable) not support destructuring assignment syntax yet: https://kangax.github.io/compat-table/es6/#destructuring
looks it's in 49+ though!
Comments
Post a Comment