code: function fromNumber(num, base) {
    if (num == 0) return [0];
  
    let arr = [];
    while (num > 0) {
      arr.push(num % base);
      num = Math.floor(num / base);
    }
    return arr;
  }
docs: /* Express a number as an integer array in a given base.
  * The number must be a nonzero integer.
  *
  * @param {number} num - A positive integer in number format.
  * @param {number} base - The desired base of the integer array.
  * @return {number[]} - The integer array.