I have a way of thinking which makes it very easy to understand and remember how '...' works.
var arr = [1,2,3] // this is arr which is the array
on the other hand
...arr // this is whatever inside arr, which is 1,2,3
So you can also think of it as taking what is inside of an array.
Note that by its own, ...arr is not a valid syntax. You can use it in many ways , two of them coming to my mind are :
1 - Pass what is inside an array to a function
var arr = [ 1,2,3 ]
var myFunc = function(a,b,c) {
console.log(a,b,c)
}
myFunc(..arr) // logs 1 2 3
myFunc(1,2,3) // logs 1 2 3
2 - Take what is inside of an array and use them in another array.
var arr = [ 1,2,3 ]
var foo = [ ...arr, 4,5,6 ] // now foo is [ 1,2,3,4,5,6 ]
Answer from FurkanO on Stack OverflowMozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Expressions_and_operators
Expressions and operators - JavaScript | MDN
For example, x++ or ++x. The operator operand form is called a prefix unary operator, and the operand operator form is called a postfix unary operator. ++ and -- are the only postfix operators in JavaScript — all other operators, like !, typeof, etc.
W3Schools
w3schools.com › js › js_operators.asp
JavaScript Operators
Assignment operators assign values to JavaScript variables. The Addition Assignment Operator (+=) adds a value to a variable. ... Assignment operators are fully described in the JS Assignment chapter.
Videos
01:14:14
Day 03: MASTER Operators & Expressions in JavaScript 🤩 - YouTube
11:13
Javascript Operators (With Examples) | JavaScript Tutorial - YouTube
17:11
#5 JavaScript - Operators | JavaScript Tutorials for Beginners ...
07:33
JavaScript Operators | JS for Beginners #javascript #js - YouTube
Learn JavaScript LOGICAL OPERATORS in 5 minutes
JavaScript ARITHMETIC OPERATORS in 8 minutes! ➕
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › in
in - JavaScript | MDN
The in operator returns true if the specified property is in the specified object or its prototype chain.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-operators
JavaScript Operators - GeeksforGeeks
JavaScript operators are symbols or keywords used to perform operations on values and variables. They are the building blocks of JavaScript expressions and can manipulate data in various ways.
Published July 30, 2025
TutorialsPoint
tutorialspoint.com › javascript › javascript_operators.htm
JavaScript - Operators
In JavaScript, an operator is a symbol that performs an operation on one or more operands, such as variables or values, and returns a result. Let us take a simple expression 4 + 5 is equal to 9. Here 4 and 5 are called operands, and + is called the operator.
Programiz
programiz.com › javascript › operators
JavaScript Operators (with Examples)
JavaScript operators are special symbols that perform operations on one or more operands (values). In this tutorial, you will learn about JavaScript operators with the help of examples.
Reddit
reddit.com › r/javascript › javascript's ??= operator
r/javascript on Reddit: JavaScript's ??= Operator
November 5, 2024 - I think it’s still in the pipe, so to speak, but I sincerely hope they just take the elixir/erlang one and shamelessly copy it. It works, there’s no good reason to mess with it. ... Which makes me wonder, if a op= b means a = a op b, then surely a === b should be the same as a = a == b, right? ... I didn't know this operator existed tbh.
W3Schools
w3schools.com › jsref › jsref_operators.asp
JavaScript Operators Reference
JavaScript Operators are used to assign values, compare values, perform arithmetic operations, and much more.
BrainStation®
brainstation.io › learn › javascript › operators
JavaScript Operators (2026 Tutorial & Examples) | BrainStation®
February 4, 2025 - It is highly recommended that Developers in JavaScript always use triple equal sign === or strict equality comparison. == sign compares only the values to be either truthy or falsy while === compares both the values and as well the type of both the values to be equal for a more strict comparison. Here are some of the other operators available in JavaScript:
Codecademy
codecademy.com › docs › javascript › operators
JavaScript | Operators | Codecademy
December 1, 2023 - An operator is a special character or series of characters that perform a task in JavaScript.
freeCodeCamp
freecodecamp.org › news › the-javascript-in-operator-explained-with-examples
The JavaScript `in` Operator Explained With Examples
July 13, 2020 - This will return true, showing that the div element is an instance of the Object type, which is why the in operator can be used on it. You’ve learned about the not so popular JavaScript in operator, which is used to verify the presence of properties on an object or Object type instances.
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Logical operators
There are four logical operators in JavaScript: || (OR), && (AND), ! (NOT), ?? (Nullish Coalescing). Here we cover the first three, the ??