javascript map if key exists