Content-Length: 258721 | pFad | http://github.com/GameOfCode64/DSA-JavaScript/commit/#start-of-content

687310E0 new commit · GameOfCode64/DSA-JavaScript@69c9994 · GitHub
Skip to content

Commit 69c9994

Browse files
committed
new commit
1 parent 575e84e commit 69c9994

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Array/test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var findClosestNumber = function (nums) {
2+
let close = nums[0];
3+
for (let i = 0; i < nums.length; i++) {
4+
if (nums[i] < close) {
5+
close = nums[i];
6+
}
7+
return close;
8+
}
9+
};
10+
11+
console.log(findClosestNumber([-4, -2, 1, 4, 8]));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/GameOfCode64/DSA-JavaScript/commit/#start-of-content

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy