split the numbers js

JavaScript
var num = 123456;
var digits = num.toString().split('').map(iNum => parseInt(iNum, 10));
console.log(digits);
Source

Also in JavaScript: