Ad
  • Custom User Avatar

    U can use this method as well -
    const arrayOfDigits = Array.from(String(num), Number);

    here, Array.from() creates a new array from the array-like object, by passing String(num), we convert the number into a string, which splits it into its individual characters
    the second parameter, Number, is a callback that converts each character back into a digit, creating an array of digits from the number

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution