There are variables:

var second_massiv = []; var а = 45, b = 79 

How to put in the array second_massiv numbers а and b , breaking them into 4,5,7,9?

    2 answers 2

     var а = 45, b = 79; var res = (""+a+b).split("").map(Number); 
    • Thank you, you didn't even need an array - Mr.Steps

    ES6, don't do that :)

     var second_massiv = []; var а = 45, b = 79; second_massiv.push(...[...`${a}`, ...`${b}`].map(Number)); 
    • const second_massiv = [...`${a}`, ...`${b}`].map(Number) - Roman Paradeev
    • @RomanParadeev, the idea was to supplement the existing array (although in the example it’s empty), and yes, to create a new one, push-shaman is not necessary. - Qwertiy