A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.
My first article/video in the series talks about Object Destructuring. The second one, discusses Array Destructuring. The third topic is on writing relaxed JSON. The topic I have discussed here is Rest Operator that allows you to create a function with variable number of arguments.
The topic I have discussed here is Rest Operator that allows you to create a function with variable number of arguments.
let add = function(x,y,...numbers){ // console.log(arguments); let total = 0 numbers.forEach(num => { total += num }) console.log(total); } //add([1,2,3,4,5]) add(1,2,3,4,5)
You can watch the video here