I’m doing one of Kata challenges on Code Wars and I’m a beginner at JS but I really really want to solve this one…

can someone please let me know if for the below exercise, my solution (which doesn’t work) is going in the right direction?

Aim: get rid of zeros only at the end of a number:

1450 - 145

1500 - 15

10500 - 105

My solution - am I going in the right direction?

function zero(n) {

for(i = 0; i > n.length; i++) {

if(n.endsWith == 0) {

n.splice();

}

} return n;

}