My confusion lies in the for loop within this function that seems to never run. Each console log is set up to return a specific value, but the looping action doesn't trigger. Can someone provide insight into what might be causing this issue?
export function arrayChange(inputArray: number[]): number {
let total = 0;
console.log('inputArray.length', inputArray.length) // outputs 3
console.log('inputArr', inputArray[0] <= inputArray[1]) //outputs true
for(let i = 0; i > inputArray.length - 1; i++){
console.log('hello') //fails to execute
if(inputArray[i] <= inputArray[i + 1]){
total += inputArray[i + 1] - inputArray[i] + 1
}
}
return total
}
console.log(arrayChange([1, 3, 4])); //outputs 0