From ef16324aa1fa54eece0241fbb588e0fc5fd9e4dd Mon Sep 17 00:00:00 2001 From: yuma Date: Tue, 28 Feb 2023 01:07:31 +0900 Subject: [PATCH] =?UTF-8?q?Array.prototype.length=E3=82=92=E3=82=A2?= =?UTF-8?q?=E3=82=AF=E3=82=BB=E3=83=83=E3=82=B5=E3=83=97=E3=83=AD=E3=83=91?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=81=A7=E5=86=8D=E7=8F=BE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this.items.lengthの部分はthisにgetterのlengthが生えているため、可読性を考慮してthis.lengthに変更した --- source/basic/class/README.md | 2 +- source/basic/class/example/ArrayLike.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/basic/class/README.md b/source/basic/class/README.md index ac9f2ac973..86dddee5a4 100644 --- a/source/basic/class/README.md +++ b/source/basic/class/README.md @@ -456,7 +456,7 @@ class ArrayLike { } set length(newLength) { - const currentItemLength = this.items.length; + const currentItemLength = this.length; // 現在要素数より小さな`newLength`が指定された場合、指定した要素数となるように末尾を削除する if (newLength < currentItemLength) { this._items = this.items.slice(0, newLength); diff --git a/source/basic/class/example/ArrayLike.js b/source/basic/class/example/ArrayLike.js index 298d2db2c7..28d45d8433 100644 --- a/source/basic/class/example/ArrayLike.js +++ b/source/basic/class/example/ArrayLike.js @@ -15,7 +15,7 @@ class ArrayLike { } set length(newLength) { - const currentItemLength = this.items.length; + const currentItemLength = this.length; // 現在要素数より小さな`newLength`が指定された場合、指定した要素数となるように末尾を削除する if (newLength < currentItemLength) { this._items = this.items.slice(0, newLength);