ReferenceError: item is not defined nodejs

Solution 1:

Problem is with this this line

const result = City.map(item = item.name);

the first argument of .map is a callback function. You are doing an assignment

const result = City.map(item => item.name);