Sha256: bd748e263b99d9bc7dfb71b91262d83c27175e5732a2875056c0965fcc4ab068
Contents?: true
Size: 742 Bytes
Versions: 14
Compression:
Stored size: 742 Bytes
Contents
/** * Retrieves the value of a specified nested property from all elements in * the Observable sequence. * @param {Arguments} arguments The nested properties to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function () { var args = arguments, len = arguments.length; if (len === 0) { throw new Error('List of properties cannot be empty.'); } return this.map(function (x) { var currentProp = x; for (var i = 0; i < len; i++) { var p = currentProp[args[i]]; if (typeof p !== 'undefined') { currentProp = p; } else { return undefined; } } return currentProp; }); };
Version data entries
14 entries across 7 versions & 1 rubygems