From 8ecf7f35f7b13f17d2808befba8d4949d7a15eee Mon Sep 17 00:00:00 2001 From: Jongha Kim Date: Sat, 13 Jul 2024 23:23:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[ko]=20SharedArrayBuffer.prototype.byteLeng?= =?UTF-8?q?th=20=EC=8B=A0=EA=B7=9C=20=EC=B6=94=EA=B0=80=20=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SharedArrayBuffer.prototype.byteLength 신규 추가 - Set.prototype.add() 최신화 - Set.prototype.clear() 최신화 --- .../reference/global_objects/set/add/index.md | 18 +++++---- .../global_objects/set/clear/index.md | 28 +++++++++----- .../sharedarraybuffer/bytelength/index.md | 37 +++++++++++++++++++ 3 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md diff --git a/files/ko/web/javascript/reference/global_objects/set/add/index.md b/files/ko/web/javascript/reference/global_objects/set/add/index.md index 55d1f0cbeac84b..bcb4c30f7c72aa 100644 --- a/files/ko/web/javascript/reference/global_objects/set/add/index.md +++ b/files/ko/web/javascript/reference/global_objects/set/add/index.md @@ -1,18 +1,20 @@ --- title: Set.prototype.add() slug: Web/JavaScript/Reference/Global_Objects/Set/add +l10n: + sourceCommit: 5e878acadb7afcf0443b619b1d2f70a4dfafd679 --- {{JSRef}} -**`add()`** 메서드는 `Set` 개체의 맨 뒤에 주어진 `value`의 새 요소를 추가합니다. +{{jsxref("Set")}} 인스턴스의 **`add()`** 메서드는 같은 값인 요소가 이 Set에 없다면 지정된 값과 함께 새로운 요소를 이 Set에 삽입합니다. {{EmbedInteractiveExample("pages/js/set-prototype-add.html")}} ## 구문 -```js -mySet.add(value); +```js-nolint +add(value) ``` ### 매개변수 @@ -22,23 +24,23 @@ mySet.add(value); ### 반환 값 -`Set` 객체. +추가된 값이 포함된 `Set` 객체. ## 예제 ### `add` 메서드 사용하기 ```js -var mySet = new Set(); +const mySet = new Set(); mySet.add(1); -mySet.add(5).add("어떤 문자열"); // 계속 붙일 수 있음 +mySet.add(5).add("some text"); // 계속 붙일 수 있음 console.log(mySet); -// Set [1, 5, "어떤 문자열"] +// Set [1, 5, "some text"] ``` -## 명세 +## 명세서 {{Specifications}} diff --git a/files/ko/web/javascript/reference/global_objects/set/clear/index.md b/files/ko/web/javascript/reference/global_objects/set/clear/index.md index 9866f78c19d796..b745b7d8fc8630 100644 --- a/files/ko/web/javascript/reference/global_objects/set/clear/index.md +++ b/files/ko/web/javascript/reference/global_objects/set/clear/index.md @@ -1,39 +1,49 @@ --- title: Set.prototype.clear() slug: Web/JavaScript/Reference/Global_Objects/Set/clear +l10n: + sourceCommit: 4776b8fddca8ed71adc9c0f12712820db8d02371 --- {{JSRef}} -**`clear()`** 메서드는 `Set` 객체를 비웁니다. +{{jsxref("Set")}} 인스턴스의 **`clear()`** 메서드는 이 Set의 모든 요소를 삭제합니다. {{EmbedInteractiveExample("pages/js/set-prototype-clear.html")}} ## 구문 -```js -mySet.clear(); +```js-nolint +clear() ``` +### 매개변수 + +없음. + +### 반환 값 + +없음 ({{jsxref("undefined")}}). + ## 예제 ### `clear()` 사용하기 ```js -var mySet = new Set(); +const mySet = new Set(); mySet.add(1); mySet.add("foo"); -mySet.size; // 2 -mySet.has("foo"); // true +console.log(mySet.size); // 2 +console.log(mySet.has("foo")); // true mySet.clear(); -mySet.size; // 0 -mySet.has("bar"); // false +console.log(mySet.size); // 0 +console.log(mySet.has("foo")); // false ``` -## 명세 +## 명세서 {{Specifications}} diff --git a/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md b/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md new file mode 100644 index 00000000000000..a420be293c3a3d --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md @@ -0,0 +1,37 @@ +--- +title: SharedArrayBuffer.prototype.byteLength +slug: Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/byteLength +l10n: + sourceCommit: c2445ce1dc3a0170e2fbfdbee10e18a7455c2282 +--- + +{{JSRef}} + +{{jsxref("SharedArrayBuffer")}} 인스턴스의 **`byteLength`** 접근자 속성은 이 `SharedArrayBuffer`의 바이트 단위 길이를 반환합니다. + +{{EmbedInteractiveExample("pages/js/sharedarraybuffer-bytelength.html", "shorter")}} + +## 설명 + +`byteLength` 속성은 접근자 속성으로 설정 접근자 함수는 `undefined`입니다. 즉, 이 속성은 읽기 전용입니다. 이 값은 공유 배열이 생성될때 값이 설정되며, 변경할 수 없습니다. + +## 예제 + +### byteLength 사용하기 + +```js +const sab = new SharedArrayBuffer(1024); +sab.byteLength; // 1024 +``` + +## 명세서 + +{{Specifications}} + +## 브라우저 호환성 + +{{Compat}} + +## 같이 보기 + +- {{jsxref("SharedArrayBuffer")}} \ No newline at end of file From aac36a1153f42168d2e9fb56a28d293637b086db Mon Sep 17 00:00:00 2001 From: Jongha Kim Date: Sat, 13 Jul 2024 23:34:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?lint=20=EC=97=90=EB=9F=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global_objects/sharedarraybuffer/bytelength/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md b/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md index a420be293c3a3d..835ca7c6a1244f 100644 --- a/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md +++ b/files/ko/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md @@ -34,4 +34,4 @@ sab.byteLength; // 1024 ## 같이 보기 -- {{jsxref("SharedArrayBuffer")}} \ No newline at end of file +- {{jsxref("SharedArrayBuffer")}}