From 1311feb4625f9c8a5c43d945cb12a20c28b93bbe Mon Sep 17 00:00:00 2001 From: Taeyang Kim Date: Mon, 6 Sep 2021 18:21:18 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[=EB=82=98=EB=A8=B8=EC=A7=80=20=EB=A7=A4?= =?UTF-8?q?=EA=B0=9C=EB=B3=80=EC=88=98=EC=99=80=20=EC=A0=84=EA=B0=9C=20?= =?UTF-8?q?=EB=AC=B8=EB=B2=95]=20=EB=B3=B8=EB=AC=B8=20=EB=B2=88=EC=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-rest-parameters-spread/article.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md index 280986d4bf..66be690005 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md +++ b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md @@ -225,49 +225,49 @@ alert( Array.from(str) ); // H,e,l,l,o 이런 이유때문에 무언가를 배열로 바꿀 때는 전개 문법보다 `Array.from`이 보편적으로 사용됩니다. -## Get a new copy of an array/object +## 배열 / 객체의 사본 만들기 -Remember when we talked about `Object.assign()` [in the past](info:object-copy#cloning-and-merging-object-assign)? +객체를 복사하기 위해 `Object.assign()`을 [공부했던 것](info:object-copy#cloning-and-merging-object-assign)을 기억하시나요? -It is possible to do the same thing with the spread syntax. +전개 연산자를 사용해서 동일한 작업을 할 수 있습니다. ```js run let arr = [1, 2, 3]; -let arrCopy = [...arr]; // spread the array into a list of parameters - // then put the result into a new array +let arrCopy = [...arr]; // 기존 배열을 매개변수로 전달하여 + // 그 결과를 새 배열에 넣습니다. -// do the arrays have the same contents? +// 두 배열의 내용이 동일합니까? alert(JSON.stringify(arr) === JSON.stringify(arrCopy)); // true -// are the arrays equal? -alert(arr === arrCopy); // false (not same reference) +// 두 배열이 동일합니까? +alert(arr === arrCopy); // false (참조가 다름) -// modifying our initial array does not modify the copy: +// 원본 배열을 수정해도 사본 배열은 변하지 않습니다. arr.push(4); alert(arr); // 1, 2, 3, 4 alert(arrCopy); // 1, 2, 3 ``` -Note that it is possible to do the same thing to make a copy of an object: +객체의 사본을 만드는 것도 동일합니다. ```js run let obj = { a: 1, b: 2, c: 3 }; -let objCopy = { ...obj }; // spread the object into a list of parameters - // then return the result in a new object +let objCopy = { ...obj }; // 기존 객체를 매개변수로 전달하여 + // 그 결과를 새 객체에 넣습니다. -// do the objects have the same contents? +// 두 객체의 내용이 동일합니까? alert(JSON.stringify(obj) === JSON.stringify(objCopy)); // true -// are the objects equal? -alert(obj === objCopy); // false (not same reference) +// 두 객체가 동일합니까? +alert(obj === objCopy); // false (참조가 다름) -// modifying our initial object does not modify the copy: +// 원본 객체를 수정해도 사본 객체는 변하지 않습니다. obj.d = 4; alert(JSON.stringify(obj)); // {"a":1,"b":2,"c":3,"d":4} alert(JSON.stringify(objCopy)); // {"a":1,"b":2,"c":3} ``` -This way of copying an object is much shorter than `let objCopy = Object.assign({}, obj);` or for an array `let arrCopy = Object.assign([], arr);` so we prefer to use it whenever we can. +객체에 `let objCopy = Object.assign({}, obj);`를, 배열에 `let arrCopy = Object.assign([], arr)`을 사용하는 것보다 이 방법으로 복사하는 것이 코드가 짧기에 가능한 한 이 방법을 사용하는 것이 좋습니다. ## 요약 From 52439a51d29e1ba6b65db3f6c485700d25bde273 Mon Sep 17 00:00:00 2001 From: Taeyang Kim Date: Mon, 6 Sep 2021 18:22:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"[=EB=82=98=EB=A8=B8=EC=A7=80=20?= =?UTF-8?q?=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=EC=99=80=20=EC=A0=84?= =?UTF-8?q?=EA=B0=9C=20=EB=AC=B8=EB=B2=95]=20=EB=B3=B8=EB=AC=B8=20?= =?UTF-8?q?=EB=B2=88=EC=97=AD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1311feb4 --- .../02-rest-parameters-spread/article.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md index 66be690005..280986d4bf 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md +++ b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md @@ -225,49 +225,49 @@ alert( Array.from(str) ); // H,e,l,l,o 이런 이유때문에 무언가를 배열로 바꿀 때는 전개 문법보다 `Array.from`이 보편적으로 사용됩니다. -## 배열 / 객체의 사본 만들기 +## Get a new copy of an array/object -객체를 복사하기 위해 `Object.assign()`을 [공부했던 것](info:object-copy#cloning-and-merging-object-assign)을 기억하시나요? +Remember when we talked about `Object.assign()` [in the past](info:object-copy#cloning-and-merging-object-assign)? -전개 연산자를 사용해서 동일한 작업을 할 수 있습니다. +It is possible to do the same thing with the spread syntax. ```js run let arr = [1, 2, 3]; -let arrCopy = [...arr]; // 기존 배열을 매개변수로 전달하여 - // 그 결과를 새 배열에 넣습니다. +let arrCopy = [...arr]; // spread the array into a list of parameters + // then put the result into a new array -// 두 배열의 내용이 동일합니까? +// do the arrays have the same contents? alert(JSON.stringify(arr) === JSON.stringify(arrCopy)); // true -// 두 배열이 동일합니까? -alert(arr === arrCopy); // false (참조가 다름) +// are the arrays equal? +alert(arr === arrCopy); // false (not same reference) -// 원본 배열을 수정해도 사본 배열은 변하지 않습니다. +// modifying our initial array does not modify the copy: arr.push(4); alert(arr); // 1, 2, 3, 4 alert(arrCopy); // 1, 2, 3 ``` -객체의 사본을 만드는 것도 동일합니다. +Note that it is possible to do the same thing to make a copy of an object: ```js run let obj = { a: 1, b: 2, c: 3 }; -let objCopy = { ...obj }; // 기존 객체를 매개변수로 전달하여 - // 그 결과를 새 객체에 넣습니다. +let objCopy = { ...obj }; // spread the object into a list of parameters + // then return the result in a new object -// 두 객체의 내용이 동일합니까? +// do the objects have the same contents? alert(JSON.stringify(obj) === JSON.stringify(objCopy)); // true -// 두 객체가 동일합니까? -alert(obj === objCopy); // false (참조가 다름) +// are the objects equal? +alert(obj === objCopy); // false (not same reference) -// 원본 객체를 수정해도 사본 객체는 변하지 않습니다. +// modifying our initial object does not modify the copy: obj.d = 4; alert(JSON.stringify(obj)); // {"a":1,"b":2,"c":3,"d":4} alert(JSON.stringify(objCopy)); // {"a":1,"b":2,"c":3} ``` -객체에 `let objCopy = Object.assign({}, obj);`를, 배열에 `let arrCopy = Object.assign([], arr)`을 사용하는 것보다 이 방법으로 복사하는 것이 코드가 짧기에 가능한 한 이 방법을 사용하는 것이 좋습니다. +This way of copying an object is much shorter than `let objCopy = Object.assign({}, obj);` or for an array `let arrCopy = Object.assign([], arr);` so we prefer to use it whenever we can. ## 요약 From 52dd20ec1bf1aa58db74d1ad5976dcec8121a9f1 Mon Sep 17 00:00:00 2001 From: Taeyang Kim Date: Mon, 6 Sep 2021 18:28:11 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[=EB=82=98=EB=A8=B8=EC=A7=80=20=EB=A7=A4?= =?UTF-8?q?=EA=B0=9C=EB=B3=80=EC=88=98=EC=99=80=20=EC=A0=84=EA=B0=9C=20?= =?UTF-8?q?=EB=AC=B8=EB=B2=95]=20=EB=B3=B8=EB=AC=B8=20=EB=B2=88=EC=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-rest-parameters-spread/article.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md index 280986d4bf..66be690005 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread/article.md +++ b/1-js/06-advanced-functions/02-rest-parameters-spread/article.md @@ -225,49 +225,49 @@ alert( Array.from(str) ); // H,e,l,l,o 이런 이유때문에 무언가를 배열로 바꿀 때는 전개 문법보다 `Array.from`이 보편적으로 사용됩니다. -## Get a new copy of an array/object +## 배열 / 객체의 사본 만들기 -Remember when we talked about `Object.assign()` [in the past](info:object-copy#cloning-and-merging-object-assign)? +객체를 복사하기 위해 `Object.assign()`을 [공부했던 것](info:object-copy#cloning-and-merging-object-assign)을 기억하시나요? -It is possible to do the same thing with the spread syntax. +전개 연산자를 사용해서 동일한 작업을 할 수 있습니다. ```js run let arr = [1, 2, 3]; -let arrCopy = [...arr]; // spread the array into a list of parameters - // then put the result into a new array +let arrCopy = [...arr]; // 기존 배열을 매개변수로 전달하여 + // 그 결과를 새 배열에 넣습니다. -// do the arrays have the same contents? +// 두 배열의 내용이 동일합니까? alert(JSON.stringify(arr) === JSON.stringify(arrCopy)); // true -// are the arrays equal? -alert(arr === arrCopy); // false (not same reference) +// 두 배열이 동일합니까? +alert(arr === arrCopy); // false (참조가 다름) -// modifying our initial array does not modify the copy: +// 원본 배열을 수정해도 사본 배열은 변하지 않습니다. arr.push(4); alert(arr); // 1, 2, 3, 4 alert(arrCopy); // 1, 2, 3 ``` -Note that it is possible to do the same thing to make a copy of an object: +객체의 사본을 만드는 것도 동일합니다. ```js run let obj = { a: 1, b: 2, c: 3 }; -let objCopy = { ...obj }; // spread the object into a list of parameters - // then return the result in a new object +let objCopy = { ...obj }; // 기존 객체를 매개변수로 전달하여 + // 그 결과를 새 객체에 넣습니다. -// do the objects have the same contents? +// 두 객체의 내용이 동일합니까? alert(JSON.stringify(obj) === JSON.stringify(objCopy)); // true -// are the objects equal? -alert(obj === objCopy); // false (not same reference) +// 두 객체가 동일합니까? +alert(obj === objCopy); // false (참조가 다름) -// modifying our initial object does not modify the copy: +// 원본 객체를 수정해도 사본 객체는 변하지 않습니다. obj.d = 4; alert(JSON.stringify(obj)); // {"a":1,"b":2,"c":3,"d":4} alert(JSON.stringify(objCopy)); // {"a":1,"b":2,"c":3} ``` -This way of copying an object is much shorter than `let objCopy = Object.assign({}, obj);` or for an array `let arrCopy = Object.assign([], arr);` so we prefer to use it whenever we can. +객체에 `let objCopy = Object.assign({}, obj);`를, 배열에 `let arrCopy = Object.assign([], arr)`을 사용하는 것보다 이 방법으로 복사하는 것이 코드가 짧기에 가능한 한 이 방법을 사용하는 것이 좋습니다. ## 요약 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy