js string array converted to number array

1. How to convert an array of strings to an array of numbers without using traversal

2. For example: ['1','2','3']=>[1,2,3]

Solution

['1','2','3'].map(Number)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325803957&siteId=291194637