Underscore.js _.result() Function
Note: If the stated defaultValue is a function then its result will be returned as output.
_.result(object, property, [defaultValue])
Parameters: It accepts three parameters which are specified below:
- object: It is the stated object.
- property: It is the property stated.
- [defaultValue]: It is the stated default value.
Return Value: This method returns the value of the named property.
Please Login to comment...