• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Jun, 2021 | Medium

QRCode

Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript. This one-liner uses the Boolean constructor to magically remove all falsy values from an array ✨.

https://twitter.com/kentcdodds/status/1009918457394225152

const plugins = [
    isProd ? optimizePlug : null,
    isProd ? prodOnlyPlug : null,
    !isProd ? testingPlug : null,
    usefulPlug,
].filter( Boolean );
https://medium.com/coding-at-dawn/kent-c-dodds-filter-trick-will-change-how-you-use-javascript-87b5112f9f6d
July 9, 2021 at 9:31:51 AM EDT *
javascript coding perl
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community