We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
array数组的常用方法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator#
const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']; const result = words.filter(word => word.length > 6); console.log(result); // expected output: Array ["exuberant", "destruction", "present"]
let a=[1,2,"b",0,{},"",NaN,3,undefined,null,5]; let b = a.filter(Boolean) // [1,2,"b",{},3,5] // 相当于对数组的每一项使用Boolean进行操作,返回true的项就会保留 // 等价于 a.filter(item => { return Boolean(item)})
The text was updated successfully, but these errors were encountered:
No branches or pull requests
array数组的常用方法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator#
filter
charAt 和 indexOf
concat
The text was updated successfully, but these errors were encountered: