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
这个问题是前两周在某个前端群里看到的,原标题貌似并没有说用fill,但是我看到人家大概这样写的,当时就觉得非常好。直到前天晚上突然回顾发现自己没理清,遂晚上再度思考并实际编写测试才算OK。
fill
各种简洁的写法都很厉害,说明那些人js功底很棒,加油!
// 第一种 Array(5).fill([1, 2, 3, 4, 5]).map((item, i) => item[i]) // [1, 2, 3, 4, 5] // 第二种 Array(5).fill(1).map((item, i) => { return item + i }) // [1, 2, 3, 4, 5]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这个问题是前两周在某个前端群里看到的,原标题貌似并没有说用
fill
,但是我看到人家大概这样写的,当时就觉得非常好。直到前天晚上突然回顾发现自己没理清,遂晚上再度思考并实际编写测试才算OK。各种简洁的写法都很厉害,说明那些人js功底很棒,加油!
The text was updated successfully, but these errors were encountered: