const reverse = x => { let arr = x.toString().split('').reverse(); if(arr.includes('-')){ arr.pop(); arr.unshift('-'); } if(arr.includes('0')){ arr.shift(); } return Number(arr.join('')); }