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:
Olivier Tassinari
2017-01-15 12:39:30 +01:00
committed by Jordan Harband
parent 712e010f29
commit b06c5c6621

View File

@@ -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>