Lambda functions and functional programming for javascript