freecodecamp小练习——Falsy Bouncer过滤数组假值

记录一下今天接触的一个关于Boolean的小知识点。 代码: function bouncer(arr) { // 请把你的代码写在这里 return arr.filter(element=>Boolean(element)); } bouncer([7, "ate", "", false, 9]);
相关文章
相关标签/搜索