title
In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.
Find the smallest integer in the array.
Given an array of integers your solution should find the smallest integer. For example:
Notes:
- Given [34, 15, 88, 2] your solution will return 2
- Given [34, -345, -1, 100] your solution will return -345
You can assume, for the purpose of this kata, that the supplied array will not be empty.
翻译
找出最小数
My solution
1 | function findSmallestInt(args){ |
good solution
1 | //...为展开运算符,属于es6语法 |