javascript map.if exists