getting rid of .map in js