mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
Avoid octal number interpretation
Some JavaScript versions interpret numbers as octal if they are written with a leading zero. Babel interpreter throws with an `Invalid number` message.
This commit is contained in:
committed by
Jordan Harband
parent
712e010f29
commit
b06c5c6621
@@ -811,10 +811,10 @@ Other Style Guides
|
||||
console.log(...x);
|
||||
|
||||
// bad
|
||||
new (Function.prototype.bind.apply(Date, [null, 2016, 08, 05]));
|
||||
new (Function.prototype.bind.apply(Date, [null, 2016, 8, 5]));
|
||||
|
||||
// good
|
||||
new Date(...[2016, 08, 05]);
|
||||
new Date(...[2016, 8, 5]);
|
||||
```
|
||||
|
||||
<a name="functions--signature-invocation-indentation"></a>
|
||||
|
||||
Reference in New Issue
Block a user