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/javascript_quirks.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
1. The JavaScript standard ([ECMA-262][ecma-262-math-round]) defines the behavior of `Math.round` such that "ties" (e.g., `1.5` and `-1.5`) are rounded toward `+infinity`.
Copy file name to clipboardExpand all lines: docs/style-guides/javascript/README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -884,6 +884,8 @@ Allows compiler to pre-allocate memory.
884
884
885
885
##### Bad Example
886
886
887
+
<!-- eslint-disable stdlib/no-builtin-math -->
888
+
887
889
```javascript
888
890
// Do not...
889
891
var arr = [];
@@ -895,6 +897,8 @@ for ( i = 0; i < 100; i++ ) {
895
897
896
898
##### Good Example
897
899
900
+
<!-- eslint-disable stdlib/no-builtin-math -->
901
+
898
902
```javascript
899
903
// Do...
900
904
var arr =newArray( 100 );
@@ -908,6 +912,8 @@ for ( i = 0; i < arr.length; i++ ) {
908
912
909
913
- 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
914
915
+
<!-- eslint-disable stdlib/no-builtin-math -->
916
+
911
917
```javascript
912
918
var arr;
913
919
var i;
@@ -967,6 +973,8 @@ When copying a small `array`, using `Array#slice()` incurs a function overhead w
967
973
968
974
##### Small Array Example
969
975
976
+
<!-- eslint-disable stdlib/no-builtin-math -->
977
+
970
978
```javascript
971
979
// Do...
972
980
var arr =newArray( 10 );
@@ -983,6 +991,8 @@ for ( i = 0; i < arr.length; i++ ) {
983
991
984
992
##### Large Array Example
985
993
994
+
<!-- eslint-disable stdlib/no-builtin-math -->
995
+
986
996
```javascript
987
997
// Do...
988
998
var arr =newArray( 10000 );
@@ -1317,7 +1327,7 @@ for ( var i = 0; i < 10; i++ ) {
@@ -1424,6 +1436,8 @@ function getEquation( a, b, c ) {
1424
1436
1425
1437
##### Good Example
1426
1438
1439
+
<!-- eslint-disable stdlib/no-builtin-math -->
1440
+
1427
1441
```javascript
1428
1442
// Do...
1429
1443
functiongetEquation( a, b, c ) {
@@ -2682,6 +2696,8 @@ function factorial( x ) {
2682
2696
2683
2697
Use `// NOTE:` to annotate questions, comments, or anything which does not fit under `TODO`, `FIXME`, `HACK`, `WARNING`, `OPTIMIZE` which should be brought to a user's attention.
2684
2698
2699
+
<!-- eslint-disable stdlib/no-builtin-math -->
2700
+
2685
2701
```javascript
2686
2702
// NOTE: consider optimizing this for large arrays (len > 64K).
0 commit comments