• JS mission End Zeroes

Question related to mission End Zeros

 

Hello, I can't get my solution accepted and I don't understand what is wrong.

My code:

function endZeros(a: number): number {

let b = String(a);
let out:number = 0;
for (let i = b.length - 1; i >= 0; i--)
{
    if (b[i] != 0) { return out }
    out += 1;

}

return out;

}

When checking solution I get error:

9,13: This condition will always return 'true' since the types 'string' and 'number' have no overlap.