Echo JS 0.11.0

<~>
xat 2741 days ago. link parent 1 point
You can check for the existence of a property with obj.hasOwnProperty('someProp').

Replies

jth0024 2741 days ago. link 1 point
Yep, you can. But like I said, if I were only hoping to apply default values for missing properties I would just use Object.assign like others have suggested. Instead, I wanted the ability to use any conditional check that I choose when merging values, and I wrote this library because I've frequently needed to write little wrappers that used Object.assign to do that. It's useful to me because it provides an easy way to perform common tasks with less code. I didn't write the library because I'm unfamiliar with ES2015 or the Object API.