assume i have an object call userData = {..}
and I want to define an object userDataB with properties a,b,c and d from userData but only of those which defined. I know I can do something like this:
userDataB = {}
if(userData.a){userDataB.a = a};
if(userData.b){userDataB.b = b};
...
but, there is something cleaner? mayber from es5 or es6?
{}for{ a: 0, b: "" }, not sure if that is intended.