{"id":3736,"date":"2019-11-25T00:00:00","date_gmt":"2019-11-25T00:00:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/"},"modified":"2026-04-28T14:04:53","modified_gmt":"2026-04-28T14:04:53","slug":"drie-nuttige-punten-de-rest-en-de-verspreiding-in-javascript","status":"publish","type":"post","link":"https:\/\/thecodest.co\/nl\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/","title":{"rendered":"Drie nuttige punten - de rest en de spreiding in JavaScript"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#rest-parameters\">Rest parameters<\/a><\/h2>\n\n\n\n<p>The rest syntax allows <a href=\"https:\/\/thecodest.co\/nl\/blog\/why-us-companies-are-opting-for-polish-developers\/\">us<\/a> to represent an indefinite number of arguments as an array. Take a look at a function that adds up all the arguments passed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const sum = (...args) =&gt; args.reduce((prev, current) =&gt; prev + current);\n\nconsole.log(sum(1, 2)); \/\/ 3\nconsole.log(sum(1, 2, 3)); \/\/ 6<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#spread-syntax\">Spread syntax<\/a><\/h2>\n\n\n\n<p>The spread operator allows us to expand iterable objects into individual elements. This functionality is opposite to what we achieved with the rest parameters. It can be applied to all iterables, such as arrays, objects, sets, maps, etc.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const sum = (x, y, z) =&gt; x + y + z;\nconst numbers = [1, 2, 3];\n\nconsole.log(sum(...numbers)); \/\/ 6<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#three-dots-in-real-use-cases\">Three dots in real use cases<\/a><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#copying-an-array\">Copying an array<\/a><\/h3>\n\n\n\n<p>The spread syntax effectively goes one level deeper while copying an array. One level means that the first level of references is copied.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const array0 = [1, [2, 3]];\nconst array1 = [...array0];\n\nconsole.log(array1); \/\/ [1, [2, 3]]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#creating-an-array-of-unique-elements\">Creating an array of unique elements<\/a><\/h3>\n\n\n\n<p>Create the Set which stores only unique elements and convert its back to an array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const array = [1, 1, 2, 3];\nconst uniqueElements = [...new Set(array)];\n\nconsole.log(uniqueElements); \/\/ [1, 2, 3]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#concatenate-arrays\">Concatenate arrays<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const array0 = [1, 2];\nconst array1 = [3, 4];\nconst concated = [...array0, ...array1];\n\nconsole.log(concated); \/\/ [1, 2, 3, 4]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#slicing-an-array\">Slicing an array<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const [firstElement, ...newArray] = [1, 2, 3, 4];\n\nconsole.log(firstElement); \/\/ 1\nconsole.log(newArray); \/\/ [2, 3, 4]<\/code><\/pre>\n\n\n\n<p>We can also remove&nbsp;<code>n<\/code>&nbsp;first elements with comma.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const [, , , ...newArray] = [1, 2, 3, 4];\n\nconsole.log(newArray); \/\/ [4]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#inserting-an-array-at-the-beginning-of-another-array\">Inserting an array at the beginning of another array<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const array0 = [4, 5, 6];\nconst array1 = [1, 2, 3];\nconst newArray = [...array1, ...array0];\n\nconsole.log(newArray); \/\/ [ 1, 2, 3, 4, 5, 6 ]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#generating-an-array-of-numbers-from-0-to-n\">Generating an array of numbers from 0 to&nbsp;<code>n<\/code><\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const array = [...Array(10)].map((_, i) =&gt; i);\n\nconsole.log(array); \/\/ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#destructuring-an-object\">Destructuring an object<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };\n\nconsole.log(x); \/\/ 1\nconsole.log(y); \/\/ 2\nconsole.log(z); \/\/ { a: 3, b: 4 }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#creating-a-copy-of-an-object\">Creating a copy of an object<\/a><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">let person = {\n  name: 'John',\n  age: 25,\n  wallet: {\n    sum: 500,\n    currency: 'USD'\n  }\n};\nlet personCopy = { ...person };\n\nconsole.log(personCopy);\n\/\/ {\n\/\/   name: 'John',\n\/\/   age: 25,\n\/\/   wallet: {\n\/\/     sum: 500,\n\/\/     currency: 'USD'\n\/\/   }\n\/\/ }<\/code><\/pre>\n\n\n\n<p>Note that the copy of the object that is created is a new object with all the original object\u2019s properties but none of its prototypal information.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">person.age = 20;\n\nconsole.log(person.age); \/\/ 20\nconsole.log(personCopy.age); \/\/ 25<\/code><\/pre>\n\n\n\n<p>Notice that spread syntax creates &#8216;shallow&#8217; copy of the object, so &#8216;wallet&#8217; property will be copied only as a reference to the original sub-object. For deep-cloning you can use JSON stringify\/parse approach or &#8216;cloneDeep&#8217; method provided by Lodash depending on your object&#8217;s complexity. In some cases this method can be helpful as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">let personCopy = { ...person, wallet = {...person.wallet}};<span style=\"background-color: initial; font-family: inherit; font-size: inherit;\"> <\/span><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#conditionally-adding-properties-to-objects\">Conditionally adding properties to objects<\/a><\/h3>\n\n\n\n<p>We can conditionally add properties to a new object that we are creating by making use of the spread operator along with short circuit evaluation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const colors = {\n  red: '#ff0000',\n  green: '#00ff00',\n  blue: '#0000ff'\n};\nconst black = {\n  black: '#000000'\n};\n\nlet extraBlack = false;\nlet conditionalMerge = {\n  ...colors,\n  ...(extraBlack ? black : {})\n};\n\nconsole.log(conditionalMerge);\n\/\/ {\n\/\/   red: '#ff0000',\n\/\/   green: '#00ff00',\n\/\/   blue: '#0000ff'\n\/\/ }\n\nextraBlack = true;\nconditionalMerge = {\n  ...colors,\n  ...(extraBlack ? black : {})\n};\n\nconsole.log(conditionalMerge);\n\/\/ {\n\/\/   red: '#ff0000',\n\/\/   green: '#00ff00',\n\/\/   blue: '#0000ff'\n\/\/   black: '#000000'\n\/\/ }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/twistezo\/articles\/blob\/master\/Three%20useful%20dots%20-%20The%20rest%20and%20The%20spread%20in%20JavaScript.md#splitting-a-string-to-characters\">Splitting a string to characters<\/a><\/h3>\n\n\n\n<p>This is similar to calling the split method with an empty string as the parameter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const split = [...'qwerty'];\nconsole.log(split); \/\/ [ 'q', 'w', 'e', 'r', 't', 'y' ]<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/contact\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/cta_2.jpeg\" alt=\"Digital product development consulting\"\/><\/a><\/figure>\n\n\n\n<p><strong>Read more:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/3-common-challenges-of-software-product-development-for-startups\">3 Common Challenges of Software Product Development for Startups<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/the-best-type-of-projects-for-java\/\">The Best Type of Projects for Java<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/how-not-to-kill-a-project-with-bad-coding-practices\/\">How not to kill a project with bad coding practices?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ECMAScript 2015 bracht ons veel nieuws, wat resulteerde in een groot aantal verbeteringen. Vandaag nemen we twee functies onder de loep die het leven eenvoudiger maken. Maak kennis met de restparemeters en de spread syntax.<\/p>","protected":false},"author":2,"featured_media":3737,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Three useful dots \u2013 the rest and the spread in JavaScript - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/nl\/blog\/drie-nuttige-punten-de-rest-en-de-verspreiding-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Three useful dots \u2013 the rest and the spread in JavaScript\" \/>\n<meta property=\"og:description\" content=\"ECMAScript 2015 brought us a lot of news, which resulted in a large number of improvements. Today we will take a closer look at two features that make life easier. Meet the rest paremeters and the spread syntax.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/nl\/blog\/drie-nuttige-punten-de-rest-en-de-verspreiding-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-25T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T14:04:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Three useful dots \u2013 the rest and the spread in JavaScript\",\"datePublished\":\"2019-11-25T00:00:00+00:00\",\"dateModified\":\"2026-04-28T14:04:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/\"},\"wordCount\":333,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-179.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/\",\"name\":\"Three useful dots \u2013 the rest and the spread in JavaScript - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-179.jpg\",\"datePublished\":\"2019-11-25T00:00:00+00:00\",\"dateModified\":\"2026-04-28T14:04:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-179.jpg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-179.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/three-useful-dots-the-rest-and-the-spread-in-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Three useful dots \u2013 the rest and the spread in JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/nl\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Drie nuttige punten - de rest en de spreiding in JavaScript - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/nl\/blog\/drie-nuttige-punten-de-rest-en-de-verspreiding-in-javascript\/","og_locale":"nl_NL","og_type":"article","og_title":"Three useful dots \u2013 the rest and the spread in JavaScript","og_description":"ECMAScript 2015 brought us a lot of news, which resulted in a large number of improvements. Today we will take a closer look at two features that make life easier. Meet the rest paremeters and the spread syntax.","og_url":"https:\/\/thecodest.co\/nl\/blog\/drie-nuttige-punten-de-rest-en-de-verspreiding-in-javascript\/","og_site_name":"The Codest","article_published_time":"2019-11-25T00:00:00+00:00","article_modified_time":"2026-04-28T14:04:53+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg","type":"image\/jpeg"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"2 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Three useful dots \u2013 the rest and the spread in JavaScript","datePublished":"2019-11-25T00:00:00+00:00","dateModified":"2026-04-28T14:04:53+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/"},"wordCount":333,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg","articleSection":["Software Development"],"inLanguage":"nl-NL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/","url":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/","name":"Drie nuttige punten - de rest en de spreiding in JavaScript - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg","datePublished":"2019-11-25T00:00:00+00:00","dateModified":"2026-04-28T14:04:53+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-179.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/three-useful-dots-the-rest-and-the-spread-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Three useful dots \u2013 the rest and the spread in JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/nl\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/posts\/3736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/comments?post=3736"}],"version-history":[{"count":7,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/posts\/3736\/revisions"}],"predecessor-version":[{"id":8068,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/posts\/3736\/revisions\/8068"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/media\/3737"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/media?parent=3736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/categories?post=3736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/nl\/wp-json\/wp\/v2\/tags?post=3736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}