Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
simonlc
on Dec 28, 2016
|
parent
|
context
|
favorite
| on:
Hyperpolyglot
Math.min.apply(Math, [1, 2, 3]) Math.max.apply(Math, [1, 2, 3])
Could just be:
Math.max(...[1, 2, 3])
hk__2
on Dec 28, 2016
[–]
The JS code is written in ES5 so this syntax is not available.
gingerrr
on Dec 28, 2016
|
parent
[–]
There are several other examples which show both ES6 and ES5 syntax, there is no reason the better ES6 syntax couldn't be shown here as well.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Could just be:
Math.max(...[1, 2, 3])