Hmm... if you just need to know that the attribute exists, you can pipe it out to a "get or create" function and make sure you return the attr. A multiline solution allows for other code interjections or tests along the way, and might look like: const getOrCreateAttribute = (n, cid) => { let attr = findObjs({ type: 'attribute', characterid: cid, name: n})[0]; if (typeof attr !== 'undefined') return attr; else { return createObj( 'attribute', { characterid: cid, name: n}); } }; Obviously you could set values in there as defaults, but you could have the value setting somewhere else come *after* this, when you're sure you've arrived at an attribute. That way, you only maintain one place for what the value-setting looks like. Another alternative, if you don't need a lot of testing or other code interjections is just to join them with a logical OR: const getOrCreateAttribute = (n, cid) => { return findObjs({ type: 'attribute', characterid: cid, name: n})[0] || createObj( 'attribute', { characterid: cid, name: n}); };