Created
July 1, 2019 10:12
-
-
Save chickenfoot88/85614e416ae8cd2a88592b496c55760c to your computer and use it in GitHub Desktop.
converts element types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numberArray = [1, 2, 3, 4, 5] | |
let stringArray = ['1', '2', '3', '4', '5'] | |
stringArray = numberArray.map(String); | |
numberArray = stringArray.map(Number); | |
console.log('numberArray', numberArray) | |
console.log('stringArray', stringArray) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment