Map Filter And Reduce Function In Javascript Definition