Ad
Code
Diff
  • export function reverseInt(n: number) {
      return +String(n).replace(/\d/g, (_, i, a) => a.slice(a.length - i - 1, a.length - i))
    }
    
    
    
    • export function reverseInt(n: number) {
    • return +String(n).split('').reverse().join('')
    • }
    • return +String(n).replace(/\d/g, (_, i, a) => a.slice(a.length - i - 1, a.length - i))
    • }