Differences between lodash and underscore:
- Lodash has improved syntax for chaining functions.
- Underscore’s chaining syntax are a bit heavy.
- Lodash is significantly larger than Underscore with a size of 33KB
- Underscore lies at about 16KB only.
- Underscore is average in speed.
- Lodash can handle nested objects.
- Underscore can handle only the base objects
- Lodash allows cloning and comparing objects that are deeply nested.
- Underscore does not allow cloning and comparing of nested objects.
Different basic commands of lodash and underscore having same functionality:
It checks if the predicate returns TRUE for any element of the collection.
It checks if the predicate returns TRUE for all elements of the collection.
It creates a function that invokes the given functions from right to left.
It looks through the list and returns the first value that matches all of the key-value pairs listed in properties.
It returns a key for each element in the list and returns an object with an index of each item.
It calls the method named by method name on each value in the list.
It transforms the value of each property in turn.
It returns the index at which value can be found in the array, or -1 if the value is not present in the array.
It looks through each value in the list and returns an array of all the values that match the key-value pairs listed in properties.
It converts an object into a list of key-value pairs.
Share your thoughts in the comments
Please Login to comment...