JSFiddle - React, Tailwind, and code Playground

by helgatheviking

JavaScript

let obj = { a: 'One', b: 'Two', c: '', d: 'Four' };
console.log(obj);

let arr;
arr = Object.keys(obj).filter(function(item) {
  return obj[item];
});

//arr = arr.filter(item => item);
console.log(arr);

// Result
// ['One', 'Two', 'Four']