How to use the construct function from ramda
Find comprehensive JavaScript ramda.construct code examples handpicked from public code repositorys.
1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
* }; * Animal.prototype.sighting = function() { * return "It's a " + this.kind + "!"; * } * * const AnimalConstructor = R.construct(Animal) * * // Notice we no longer need the 'new' keyword: * AnimalConstructor('Pig'); //=> {"kind": "Pig", "sighting": function (){...}}; *
0
0
2
+ 7 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)