SyntaxFix
Write A Post
Hire A Developer
Questions
If you are using Underscore or Lodash you can get the minimal value using this kind of simple functional pipeline
_.chain([7, 6, -1, 3, 2]).sortBy().first().value() // -1
You also have the .min function
.min
_.min([7, 6, -1, 3, 2]) // -1