DEV Community

sachin
sachin

Posted on • Originally published at codesquery.com on

2 1

What Is The Difference Between JavaScript REST and Spread

In this article, we are going to learn what is the difference between the Javascript REST and Spread. ES6 introduced the three dots(…) syntax in the Javascript and can be used depending upon the context, as a REST or Spread operator. In short, REST collects all the remaining elements into an array while Spread operator [...]

The post What Is The Difference Between JavaScript REST and Spread appeared first on CodesQuery.

Top comments (0)

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay