You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/style-guides/javascript/README.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -906,17 +906,14 @@ for ( i = 0; i < arr.length; i++ ) {
906
906
907
907
##### Notes
908
908
909
-
- Do **not** use the `new` operator if the `array` length is [greater than][array-fast-elements]`64000` due to how compilers handle "fast" elements. Instead, to ensure "fast" elements,
909
+
- Do **not** use the `new` operator if the `array` length is **very large** due to how compilers handle "fast" elements. Instead, to ensure "fast" elements,
910
910
911
911
```javascript
912
-
var len =100000;
913
912
var arr;
914
913
var i;
915
-
arr =newArray( 64000 );
916
-
for ( i =0; i <arr.length; i++ ) {
917
-
arr[ i ] =Math.random();
918
-
}
919
-
for ( i =arr.length; i < len; i++ ) {
914
+
915
+
arr = [];
916
+
for ( i =0; i <1e7; i++ ) {
920
917
arr.push( Math.random() );
921
918
}
922
919
```
@@ -3607,8 +3604,6 @@ This document may be reused under a [Creative Commons Attribution-ShareAlike Lic
0 commit comments