Advertisement
Guest User

Untitled

a guest
May 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import _ from "lodash"
  2. import R from "ramda"
  3.  
  4. function Doubler(activity: string) {
  5. this.activity = activity;
  6. }
  7.  
  8. Doubler.prototype.map = function(f) {
  9. this.activity = `${f(this.activity)} ${f(this.activity)}`
  10. return this
  11. }
  12.  
  13. function sayLoud(arg: string) { return _.upperCase(arg) }
  14.  
  15. const iceCreamEater = new Doubler("Eating ice cream");
  16.  
  17. console.log(sayLoud("something"));
  18.  
  19. console.log(R.map(sayLoud, iceCreamEater))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement