megaboich / js-map-parser

Extension for Visual Studio to improve JS support
84 stars 19 forks source link

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

Open phrontisteries opened 4 years ago

phrontisteries commented 4 years ago

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

wonkawilly commented 1 year ago

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.