Skip to content

Commit 92b15b2

Browse files
committed
Return Smallest Integer.
1 parent 5360508 commit 92b15b2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ReturnSmallestIntegerInArray.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* This is how we would return the smallest integer in an array.
3+
*/
4+
5+
// given an array of integers as an argument:
6+
7+
const returnSmallestInt = args => {
8+
return Math.min(args)
9+
}
10+
11+
let args = [2, 5, 8, 10, 14]
12+
console.log(returnSmallestInt(args))
13+
14+
/**
15+
* assuming the argument passed in is an array of values.
16+
*/

0 commit comments

Comments
 (0)