a javascript program ffunction getIndexToIns(arr, num) { arr.sort((a, b) => a - b); // To sort the array(arr) in ascending order for (let i = 0; i < arr.length; i++) { if (arr[i] >= num) return i; } // this for will retrun the value where the indexing number(num) is placed. The index will be returned return arr.length; }
-
Notifications
You must be signed in to change notification settings - Fork 0
sunnyprasad055/Where-do-I-Belong
About
a javascript program
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published