Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SmallestIntegerFinder {
- findSmallestInt(args) {
- return args.sort((a,b) => a-b)[0]
- }
- }
- // Math.min(...args)
- // Math.min(null,args)
- var a = [3,45,6,7,8,922,2,3]
- console.log(Math.min(...a)) //array to arguments
- console.log(Math.min(2,3,4,5)) //Only take !array as args
- console.log(...a) //display as arguments
Add Comment
Please, Sign In to add comment