我的代码
var arr = ['a','b',1]; var results = arr.map(function(item){ if(typeof item ==='string'){return item;} });
这会产生以下结果
["a","b",undefined]
我不想要结果数组中的undefined。我该怎么做?
undefined
用户名或邮箱地址
密码