Write a function that takes a number and returns a list of its digits

Code:

        
        
            var array = []
            function breakNumber(num){
                var input = num.toString()
                for (i  = 0;i <= input.length-1;i++){
                    array.push(input.charAt(i))
                }
                console.log(array)
            }
            //Here the value "num" passed in the function is the number
            breakNumber(num)


Output:

    
    
    //Example Output when the Number is "2233123"
    [ '2', '2', '3', '3', '3', '1', '2', '3' ]