JSFiddle - React, Tailwind, and code Playground

by tonytlwu

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"></script>

JavaScript

var a = _.pickBy({
  a: '',
  b: null,
  c: undefined,
  d: NaN,
  e: true,
  f: false,
  g: 1,
  h: 0,
  i: '1',
  j: 'false'
}, (o) => {
  return (_.isNumber(o) && !_.isNaN(o)) || (_.isString(o) && o.length);
});

console.log(a);