![]() ![]() ![]() Objects are considered empty if they have no own enumerable string keyed properties.Īrray-like values such as arguments objects, arrays, buffers, strings, or jQuery-like collections are considered empty if they have a length of 0. So, _.isEmpty(value) Is this too obvious it checks the value is empty or not? But, my assumption is wrong, it doesn’t work to all types, so according to the documentationĬhecks if value is an empty object, collection, map, or set. My most common use cases are safely getting nested properties with _.get() and checking empty value with _.isEmpty(). Upon my discovery of the JavaScript world, I found the heavy use of lodash as my number one library to have a quick, reliable and performance-proven utility belt - my sweet Batman belt.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |