
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What are the latest operators added to JavaScript?
The latest operators added to JavaScript are spread operator and rest.
Rest operator
With rest parameter, you can represent number of arguments as an array. ES6 brought rest parameter to ease the work of developers. For arguments objects, rest parameters are indicated by three dots … and preceds a parameter.
Example
Let’s see the following code snippet to define rest parameter
<html> <body> <script> function addition(…numbers) { var res = 0; numbers.forEach(function (number) { res += number; }); return res; } document.write(addition(3)); document.write(addition(9,10,11,12,13)); </script> </body> </html>
Spread Operator
It allow the expression 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
- What are JavaScript Operators
- What are operators in JavaScript?
- What are JavaScript Bitwise Operators?
- What are Arithmetic Operators in JavaScript?
- What are Comparison Operators in JavaScript?
- What are Logical Operators in JavaScript?
- What are Assignment Operators in JavaScript?
- What are Conditional Operators in JavaScript?
- What are basic JavaScript mathematical operators?
- what are the latest apple products?
- What types of logical operators are in javascript?
- What Are The Latest Mobile App Development Trends?
- What Are the Latest Digital Marketing Strategies and Topics?
- What Are the Latest Trends in Digital Marketing for Business?
- ES2015: Latest version of JavaScript

Advertisements