Q:

Write a JavaScript program to converts a specified number to an array of digits

0

Write a JavaScript program to converts a specified number to an array of digits.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const digitize = n => [...`${n}`].map(i => parseInt(i));

console.log(digitize(123));
console.log(digitize(1230));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now