From 129f629e10973c31109449dcfad668d5b0bd2190 Mon Sep 17 00:00:00 2001 From: Rabin Osti <117830519+Rabin-Osti@users.noreply.github.com> Date: Thu, 18 May 2023 23:50:06 +0545 Subject: [PATCH] fix(curriculum): array spread syntax example (#50416) array literal spread syntax #50414 fixed --- ...use-the-spread-operator-to-evaluate-arrays-in-place.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.md index d2aa7189233..a1459ca284e 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place.md @@ -28,7 +28,13 @@ const maximus = Math.max(...arr); `maximus` would have a value of `89`. -`...arr` returns an unpacked array. In other words, it *spreads* the array. However, the spread operator only works in-place, like in an argument to a function or in an array literal. The following code will not work: +`...arr` returns an unpacked array. In other words, it spreads the array. However, the spread operator only works in-place, like in an argument to a function or in an array literal. For example: + +```js +const spreaded = [...arr]; +``` + +However, the following code will not work: ```js const spreaded = ...arr;