const {city, country} = input.split(/\s*,\s*/);
These are both undefined.
Input is los gatos, california
.split results in an array output but you're destructuring it as if it were an object.
Do
const [city, country] = 'los gatos, california'.split(/\s*,\s*/);
console.log(city);
console.log(country);
You destructure by using array destructuring ([..]) instead of object ({..})