---
# System prepended metadata

title: Spread Operator

---

# Spread Operator

The JavaScript spread operator (...) allows us to quickly copy all or part of an existing array or object into another array or object.

```javascript=
// without spread operator
let simpleNumbers = [1, 2, 3]
let newNumber = [simpleNumbers, 4]
console.log(newNumber)


// with spread operator
let simpleNumbersDot = [1, 2, 3]
let newNumberDot = [...simpleNumbersDot, 4]
console.log(newNumberDot);


// object type without spread operator
let myObject = {
  "name": "Akbar",
  "state": "Delhi"
}

let fullDetails = { myObject, "city": "new delhi" }
console.log(fullDetails);

// object type with spread operator
let myObjectDot = {
  "name": "Akbar",
  "state": "Delhi"
}

let fullDetailsDot = { ...myObjectDot, "city": "new delhi" }
console.log(fullDetailsDot);
```

![](https://i.imgur.com/0qwNjor.png)
