JSFiddle - React, Tailwind, and code Playground CoffeeScript square = (p) -> p*p s1 = _.once square alert s1 3 #returns 9 alert s1 4 #also returns 9