Answers for "convert number to array of numbers javascript"

10

javascript Convert an array of strings to numbers

const toNumbers = arr => arr.map(Number);
toNumbers(['1', '2', '3','4']);     // [1, 2, 3, 4]
Posted by: Guest on July-02-2020
1

number to array javascript

const n = 123456;
Array.from(n.toString()).map(Number);
// [1, 2, 3, 4, 5, 6]
Posted by: Guest on October-27-2020
2

integer to array javascript

Array.from(String(12345), Number);
Posted by: Guest on June-11-2020

Code answers related to "convert number to array of numbers javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language