Paracetamol.js๐Ÿ’Š| #182: ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ ์„ค๋ช…

2896 ๋‹จ์–ด webdevprogrammingspanishjavascript

Explica este codigo JavaScript



๋‚œ์ด๋„: Bรกsico




const persons = [
  {
    surname: 'Zoe',
    address: {
      street: {
        name: 'Sesame Street',
        number: '123',
      },
    },
  },
  {
    surname: 'Mariner',
  },
  {
    surname: 'Carmen',
    address: {
    },
  },
];

const f = (arr) => {
  return arr.map((person) => {
    return person?.address?.street?.name
  })
}

console.log(f(persons)) //?


A. ['Sesame Street', null, null]B. ['Sesame Street', undefined , undefined]C. [undefined, undefined, undefined]D. ['Sesame Street']
Respuesta en el primer comentario.

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ