I have the number "513" in a string format, and I need to convert it into an array consisting of ["5", "1", "3"]. My updated solution using code is:
function convertToArray(num){
let numArray = num.split('');
console.log(numArray);
}
convertToArray("513");
The previous code seemed lengthy and redundant, so here's a more concise version.