题解 | #判断是否包含数字#
判断是否包含数字
https://www.nowcoder.com/practice/0fcb4eb9306d4bec837d0037fe39bcf7
function containsNumber(str) {
let arr = str.split('');
arr = arr.map(e => parseFloat(e));
let res = [];
arr.forEach(e => {
if (e.toString() !== 'NaN') {
res.push(e);
}
})
if (res.length) {
return true;
} else {
return false;
}
}
深信服公司福利 896人发布