-
-
Save Phrogz/1a74e3fcfe0a37432a46aed96a7f45b3 to your computer and use it in GitHub Desktop.
Revisions
-
Phrogz revised this gist
Nov 13, 2018 . No changes.There are no files selected for viewing
-
Phrogz revised this gist
Nov 13, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ function ƒ(name){ let v,params=Array.prototype.slice.call(arguments,1); return o=>(typeof (v=o[name])==='function' ? v.apply(o,params) : v); } a = ["foo", "barmitzvah"] -
Phrogz created this gist
Nov 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ function ƒ(name){ let v,params=Array.prototype.slice.call(arguments,1); return o=>(typeof (v=o[name])==='function' ? v.apply(o,params) : v ) } a = ["foo", "barmitzvah"] a.map(ƒ('length')) // [3, 10] a.map(ƒ('toUpperCase')) // ["FOO", "BARMITZVAH"] a.map(ƒ('slice',1)) // ["oo", "armitzvah"]