Paracetamol.js馃拪| #104: Explica este c贸digo JavaScript

Cristian Fernando - Apr 20 '22 - - Dev Community

Explica este c贸digo JavaScript

驴Cu谩l de las siguientes desestrucuraciones regresa la salida por consola del ejemplo?

Dificultad: Avanzado

const metadata = {
  title: 'Scratchpad',
  translations: [
    {
      locale: 'de',
      localization_tags: [],
      last_edit: '2020-08-29T08:43:37',
      url: '/de/docs/Tools/Scratchpad',
      title: 'JavaScript-Umgebung'
    }
  ],
  url: '/es/docs/Tools/Scratchpad'
};

console.log(titulo1, titulo_anidado); //Scratchpad JavaScript-Umgebung
Enter fullscreen mode Exit fullscreen mode

A.

const {
  title:titulo1,
  translations:[
    {
      title:titulo_anidado
    }
  ]
} = metadata;
Enter fullscreen mode Exit fullscreen mode

B.

const {
  title: titulo1,
  translations: 
      title: titulo_anidado
} = metadata;
Enter fullscreen mode Exit fullscreen mode

C.

const {
  title: titulo1,
  translations:
      {{title: titulo_anidado}}
} = metadata;
Enter fullscreen mode Exit fullscreen mode

D.

const {
  title: titulo1,
  translations:
      [title: titulo_anidado]
} = metadata;
Enter fullscreen mode Exit fullscreen mode

Respuesta en el primer comentario.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .