一行代码、简洁
1. 是否包含判断可以想到数组的some函数
2. ascii字符'0'~'9', 用字符减法即可
function containsNumber(str) { return Array.prototype.some.call(str, (c) => (c.charCodeAt() - '0'.charCodeAt() >= 0 && c.charCodeAt() - '9'.charCodeAt() <= 0)); }
function containsNumber(str) { return Array.prototype.some.call(str, (c) => (c.charCodeAt() - '0'.charCodeAt() >= 0 && c.charCodeAt() - '9'.charCodeAt() <= 0)); }