From d6fa57cd2f691c32ea9f2804bbb5c152ea6af1f5 Mon Sep 17 00:00:00 2001 From: MariusTv <12083028+MariusTv@users.noreply.github.com> Date: Mon, 18 Feb 2019 00:37:56 +0200 Subject: [PATCH] Update ES6 array destructuring (#31017) --- guide/english/javascript/es6/destructuring/index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guide/english/javascript/es6/destructuring/index.md b/guide/english/javascript/es6/destructuring/index.md index e12a26fd22..fcf278ed71 100644 --- a/guide/english/javascript/es6/destructuring/index.md +++ b/guide/english/javascript/es6/destructuring/index.md @@ -32,6 +32,15 @@ console.log(firstName, lastName); // John Smith The examples above show the benefit of using the ES6 Destructuring Assignment. +You can skip some values by putting comma + +```javascript +const address = ['Rue Cler', 'Paris', 'France']; +const [street, , country] = address; +or +const [street] = address; +``` + You can also use Destructuring on objects using a similar syntax ```js