---
title: "Discussion on \"JavaScript Rest Parameters and Spread Syntax\" | Hashnode"
description: "Discussion on \"JavaScript Rest Parameters and Spread Syntax\". In this article, we will see what the rest parameters and what spread syntax is all about.\nThe example below is a summary of this article.\nconst peopleGrades = (index, ...numbers) => {  /* ...rest */\n  const array = [ ...numbers ]; // ...spread\n  ret..."
url: "https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript Rest Parameters and Spread Syntax](https://techstack.hashnode.dev/javascript-rest-parameters-and-spread-syntax?utm_source=hashnode&utm_medium=feed)

In this article, we will see what the rest parameters and what spread syntax is all about. The example below is a summary of this article. const peopleGrades = (index, ...numbers) => { /\* ...rest \*/ const array = \[ ...numbers \]; // ...spread ret...

Mar 24, 2021 · 4 min read · techstack.hashnode.dev  
Updated Jun 24, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#learn-coding](https://hashnode.com/tag/learn-coding)

## Written by

[Bello](https://hashnode.com/@techstack)

@techstack · Nigeria

  
[View profile](https://hashnode.com/@techstack)

web developer

Web technology related ➡️ blogger || video creator || author || online instructor || YouTuber || web developer || freelancer

## Responses 3

Markdown supported · ⌘↵ to post

[Sid](https://hashnode.com/@siddiq)

[Apr 21, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/607f9822eb2bd30d2d22c37b)

Ohh. In the last example I thought mydetails will be a nested object of mydatabase object.

[Bello](https://hashnode.com/@techstack)

[Apr 21, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/607f9822eb2bd30d2d22c37b#reply-607fa33deb2bd30d2d22c457)

No spread operator only extracts the properties (key-value pairs) of an object.

[Sid](https://hashnode.com/@siddiq)

[Apr 21, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/607f9822eb2bd30d2d22c37b#reply-607fa46dc99e200d08f8187c)

[Bello](https://hashnode.com/@techstack) can we use rest to nest the object as i said?

[Ramesh](https://hashnode.com/@thisIspvr)

[Mar 27, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/605effe35aa4944ee40f84a0)

Great article.Simple and clean

[Bello](https://hashnode.com/@techstack)

[Mar 27, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/605effe35aa4944ee40f84a0#reply-605f2e0038b0e14f092a2374)

Wow... I am happy you said that. Thanks a lot.

[Richard Harris](https://hashnode.com/@richard788)

[Mar 25, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/605c9e6bbab3d73d57159901)

👍👍👍

[Bello](https://hashnode.com/@techstack)

[Mar 25, 2021](https://hashnode.com/posts/javascript-rest-parameters-and-spread-syntax/605b1d9e78c4742436d4f336/comment/605c9e6bbab3d73d57159901#reply-605cb12420b385402755505b)

I am happy you like the article [Richard Harris](https://hashnode.com/@richard788)
