I am working on an exercise and I want loop over an array and take closest number.
Code :
let num = 5;
let arr = [9, 38, 6, 0, 1];
for (let i = 0; i < arr.length; i++){
// code
}
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
I am working on an exercise and I want loop over an array and take closest number.
Code :
let num = 5;
let arr = [9, 38, 6, 0, 1];
for (let i = 0; i < arr.length; i++){
// code
}