Top "Spread-syntax" questions

Please use this tag to refer to "..." in JavaScript.

using the ... spread syntax in javascript es6 named exports

I am attempting to import everything from a library as a hash, modify it, and re-export the modified hash, without …

javascript ecmascript-6 babeljs ecmascript-next spread-syntax
Add object to the beginning of array using spread operator

I have an array like this: var oldArray = [{'value': '1', 'label': 'a'}, {'value': '2', 'label': 'b'}] what I …

javascript arrays reactjs react-redux spread-syntax
spread syntax vs slice method

I was trying to understand what is the difference between spread syntax vs slice method in the following approach. suppose …

javascript slice spread-syntax
Why does {. . . .0} evaluate to {}?

I just found {....0} in friend's code. Evaluating it in console returns {} (empty object). Why is that? What is the meaning …

javascript spread-syntax number-literal
Spread Operator not working for Redux/ES6 based sample

I am trying to understand Redux online tutorials that are posted by Dan Abramov. At present I am on the …

javascript ecmascript-6 redux polyfills spread-syntax
TS Error: Type 'string' is not an array type or a string type. How a string is not a string?

TS throws strange error: Error:(125, 18) TS2569: Type 'string' is not an array type or a string type. Use compiler option …

typescript spread-syntax
Spread operator for strings

I read about spread syntax on MDN and that it can be used with both arrays and strings: Spread syntax …

javascript ecmascript-6 spread-syntax
ES6 Spread operator to vanilla Javascript

I have added a script that uses ES6 spread operator to the project that gets the params from the url. …

javascript arrays ecmascript-6 spread-syntax ecmascript-2018
Vue spread an object as computed properties

I have an array of objects called config, and a currentIdx property in my component. Then I found myself needing …

javascript vue.js ecmascript-6 vue-cli spread-syntax
Babel 7 spread syntax in IE/Edge not working

So i have babel 7 installed, along with the plugin "@babel/plugin-proposal-object-rest-spread" included within my preset-env, however I'm still getting the …

reactjs internet-explorer babeljs ecmascript-7 spread-syntax