JAVASCRIPT Telegram 2212
CHALLENGE

function getCity(person) {
return person?.address?.city ?? 'Unknown';
}

const data = [
null,
{ name: 'Alice' },
{ name: 'Bob', address: null },
{ name: 'Charlie', address: { street: '123 Main' } },
{ name: 'David', address: { city: 'Boston' } }
];

const cities = data.map(getCity);
console.log(cities);
👍31



tgoop.com/javascript/2212
Create:
Last Update:

CHALLENGE

function getCity(person) {
return person?.address?.city ?? 'Unknown';
}

const data = [
null,
{ name: 'Alice' },
{ name: 'Bob', address: null },
{ name: 'Charlie', address: { street: '123 Main' } },
{ name: 'David', address: { city: 'Boston' } }
];

const cities = data.map(getCity);
console.log(cities);

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2212

View MORE
Open in Telegram


Telegram News

Date: |

Invite up to 200 users from your contacts to join your channel The Channel name and bio must be no more than 255 characters long The imprisonment came as Telegram said it was "surprised" by claims that privacy commissioner Ada Chung Lai-ling is seeking to block the messaging app due to doxxing content targeting police and politicians. How to Create a Private or Public Channel on Telegram? Read now
from us


Telegram JavaScript
FROM American