DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
javascript Convert an array of strings to numbers
const
toNumbers
=
arr
=>
arr
.
map
(
Number
)
;
toNumbers
(
[
'1'
,
'2'
,
'3'
,
'4'
]
)
;
// [1, 2, 3, 4]
PREVIOUS
NEXT
Tagged:
#javascript
#Convert
#array
#strings
#numbers
ADD COMMENT
Topic
COMMENT
Name
3+1 =
Submit