File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 1- ## Array Iteration and Properties
1+ ## 配列の繰り返しとプロパティ
22
3- Although arrays in JavaScript are objects, there are no good reasons to use
4- the [ ` for in loop ` ] ( #object.forinloop ) in for iteration on them. In fact there
5- are a number of good reasons ** against** the use of ` for in ` on arrays.
3+ JavaScriptの配列もまたオブジェクトですので[ ` for in ループ ` ] ( #object.forinloop ) を配列の繰り返しで使用するような理由はありません。実際、配列に` for in ` を使用** しない** 為の正当な理由はたくさんあります。
64
7- > ** Note:** JavaScript arrays are ** not** * associative arrays* . JavaScript only
8- > has [ objects] ( #object.general ) for mapping keys to values. And while associative
9- > arrays ** preserve** order, objects ** do not** .
5+ > ** 注意:** JavaScriptの配列は* 連想配列* では** ありません** 。JavaScriptは[ objects] ( #object.general ) だけがキーバリューをマッピングするものです。
6+ > また、連想配列は順序を** 保持** しますが、オブジェクトは** 保持しません** 。
107
11- Since the ` for in ` loop enumerates all the properties that are on the prototype
12- chain and the only way to exclude those properties is to use
13- [ ` hasOwnProperty ` ] ( #object.hasownproperty ) , it is already up to ** twenty times**
14- slower than a normal ` for ` loop.
8+ ` for in ` ループはプロトタイプチェーン上の全てのプロパティを列挙するため、[ ` hasOwnProperty ` ] ( #object.hasownproperty ) をそれらのプロパティの存在判定に使います。この為、通常の` for ` ループよりも** 20倍** 遅くなります。
159
1610### Iteration
1711
You can’t perform that action at this time.
0 commit comments