Hacker News new | past | comments | ask | show | jobs | submit login

Not disagreeing with your overall point, but JS can also do it more succintly:

  [1,2,3,4].reduce((a,b) => Math.max(a,b),100)
  // or
  Math.max(...[1,2,3,4])





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: