I find myself wrapping values in a function that does some work, and then simply returns the value again. It seems like it should already have a name, can anyone help me?
shout = (val) ->
console.log val + " put in safe!"
return val
safe = []
safe.push "shoe"
safe.push shout("dubloon")
Given the CoffeeScript above, shout could be described as a <half-pipe?> function, and most developers would instantly understand without seeing the implementation.
Aucun commentaire:
Enregistrer un commentaire