Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var arr = ["1", "2", "mongoose", "giraffe", "5", 0, "NaN"]
- function strToNumArr (arr) {
- return arr.map ( function (el){
- if (isNaN(el) ) {
- return 0;
- }else{
- return el;
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement