JSFiddle - React, Tailwind, and code Playground

by user2314737

JavaScript

var obj = { a: 1, b: undefined, c: 3 };

var newobj = $(obj).filter(function(key) {
    return $(this)[key]!== undefined;
  })[0];

alert(JSON.stringify(newobj));