I'm working on a function for part of a program I'm making to transpose guitar chords based on the position of a capo - not super relevant. For whatever reason, the function is not running when I call it.
function findNewChordNums(inputArr){
for(let i=0; i<inputArr; i++){
console.log(inputArr[i]);
}
return 0;
};
findNewChordNums(inputChordNums);
This is just the bare minimum of the function to make sure that it wasn't running (hence why all the loop does is console.log the array being passed into it). I made sure that the array I'm passing into the function (inputChordNums) is valid by logging it just before the function, and it has the proper values, so I'm not sure why it refuses to run. The values the array I'm passing in are 17, 12, and 20, so I should expect to see this new function log those numbers to the console.
My first guess was that it's because I'm returning 0, but I did that in a previous function which gave me the array I'm passing into this function, so I doubt that's the problem. I'm sure it's something obvious that my noobish brain is overlooking, any help would be appreciated!
for(let i=0; i<inputArr; i++) here it should be inputArr.length