CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
create.js44 linesDownload Raw Back to lodash-es
1import baseAssign from './_baseAssign.js';2import baseCreate from './_baseCreate.js';3 4/**5 * Creates an object that inherits from the `prototype` object. If a6 * `properties` object is given, its own enumerable string keyed properties7 * are assigned to the created object.8 *9 * @static10 * @memberOf _11 * @since 2.3.012 * @category Object13 * @param {Object} prototype The object to inherit from.14 * @param {Object} [properties] The properties to assign to the object.15 * @returns {Object} Returns the new object.16 * @example17 *18 * function Shape() {19 *   this.x = 0;20 *   this.y = 0;21 * }22 *23 * function Circle() {24 *   Shape.call(this);25 * }26 *27 * Circle.prototype = _.create(Shape.prototype, {28 *   'constructor': Circle29 * });30 *31 * var circle = new Circle;32 * circle instanceof Circle;33 * // => true34 *35 * circle instanceof Shape;36 * // => true37 */38function create(prototype, properties) {39  var result = baseCreate(prototype);40  return properties == null ? result : baseAssign(result, properties);41}42 43export default create;44 
basant307/AI_Governance_Project · CoolFace