- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is spread Operator (...) in JavaScript?
With Spread Operator, allow the expression to expand to multiple arguments, elements, variables, etc.
Example
You can try to run the following code to learn how to work with spread operator −
<html> <body> <script> var a, b, c,d, e, f, g; a = [10,20]; b = "rank"; c = [30,"points"]; d = "run" // concat method. e = a.concat(b, c, d); // spread operator f = [...a,b, ...c, d]; document.write(e); document.write("<br>"+f); </script> </body> </html>
- Related Articles
- JavaScript Spread Operator
- Spread operator for arrays in JavaScript
- Spread operator in function calls JavaScript
- Usage of rest parameter and spread operator in JavaScript?
- How to clone an array using spread operator in JavaScript?
- How to clone an object using spread operator in JavaScript?
- How to find maximum value in an array using spread operator in JavaScript?
- How to use spread operator to join two or more arrays in JavaScript?
- What is increment (++) operator in JavaScript?
- What is decrement (--) operator in JavaScript?
- What is Conditional Operator (?:) in JavaScript?
- What is typeof Operator in JavaScript?
- What is Modulus Operator (%) in JavaScript?
- What is Multiplication Operator (*) in JavaScript?
- What is Addition Operator (+) in JavaScript?

Advertisements