js-map-parser icon indicating copy to clipboard operation
js-map-parser copied to clipboard

Math.min(...array) or Math.max(...array)

Open phrontisteries opened this issue 5 years ago • 1 comments

var array = [0,1,2]; Math.min(...array); Math.max(...array); Error: "Unexpected token ."

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min

phrontisteries avatar Oct 17 '19 16:10 phrontisteries

Same problem with me too (v.4.2): that is due to the fact that the plugin doesn't recognize/support yet the rest/spread syntax of the recent Javascript standards. The rest/spread basically are the tree dots "..." : the rest operator puts the rest of some specific user-supplied values into a JavaScript array., while the spread syntax expands iterables into individual elements. Unfortunately the plugin is not enough up to date to support it. See also: ecma6 not supported at https://github.com/megaboich/js-map-parser/issues/6.

wonkawilly avatar Aug 08 '23 16:08 wonkawilly