Set all Object keys to false

Well here’s a one-liner with vanilla JS:

Object.keys(filter).forEach(v => filter[v] = false)

It does use an implicit loop with the .forEach() method, but you’d have to loop one way or another (unless you reset by replacing the whole object with a hardcoded default object literal).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)