curry concept in javascript