monads in javascript