Respuestas Ejercicio 47 (JS Julio)

Comparte tu respuesta del ejercicio 48.

const arr = [1, 2, 3, 4];
// escribe acá tu respuesta
const [first, second] = [1, 2];

const person = {
  name: "Pedro",
  age: 20,
};
// escribe tu respuesta acá
const { name, age } = person;
const arr = [1, 2, 3, 4];
const [first, second] = arr;

const person = {
  name: "Pedro",
  age: 20
}
const {name, age} = person;

Respuesta:

const arr = [1, 2, 3, 4];
const [first, second] = arr;

const person = {
  name: "Pedro",
  age: 20
}
const {name, age} = person;

console.log(first, second, name, age);
const [first, second] = arr;
const {name, age} = person;
const arr = [1, 2, 3, 4]

const [first, second] = arr

const person = {
  name: "Pedro",
  age: 20
}
const [first, second] = arr;
const {name, age} = person;
1 me gusta
// escribe acá tu respuesta
const[first,second]=arr;



// escribe tu respuesta acá
const {name,age} = person;

Buenas noches esta es mi solución:

const arr = [1, 2, 3, 4];
const [first, second] = arr;

const person = {
name: "Pedro",
age: 20
};
const {name, age} = person;
const arr = [1, 2, 3, 4];

[first, second] = arr

console.log(first)
console.log(second)

const person = {
    name: "Pedro",
    age: 20
}

const {name, age} = person

console.log(name)
console.log(age)
const arr = [1, 2, 3, 4]
const [first, second] = arr

const person = {
  name: "Pedro",
  age: 20
}
const {name, age} = person
const arr = [1, 2, 3, 4]
let [first,second]=arr;
const person = {
  name: "Pedro",
  age: 20
}
let {name,age}=person;

Respuesta ejercicio 47:

// Ejercicio 47
const arr = [1, 2, 3, 4]
const [first, second]  = arr
// código de prueba
console.log(first) // 1
console.log(second) // 2
const [first, second] = arr;
const {name,age}= person;

Buenas tardes
esta es mi respuesta

const arr = [1, 2, 3, 4]
// destructuración del arreglo
const [first, second] = arr


const person = {
    name: "Pedro",
    age: 20
  }
// destructuración del objeto  
const {name, age} = person

//EJERCICIO 47

//escribe tu código aqui

const arr=[1,2,3,4]

const [first,second]=arr

// código de prueba

console.log(first) // 1

console.log(second) // 2

//escribe tu código aqui

const person = {

name: “Pedro”,

age: 20

}

const {name,age}=person

// código de prueba

console.log(name) // “Pedro”

console.log(age)

const arr = [1, 2, 3, 4];

// escribe acá tu respuesta
[first, second] = arr;

const person = {
  myName: "Pedro",
  age: 20,
};

// escribe tu respuesta acá
const { myName, age } = person;

//1
const arr = [1, 2, 3, 4]
const [first,second]=arr
//2
const person = {
  name: "Pedro",
  age: 20
}
const {name,age}=person
const arr = [1, 2, 3, 4]
const [first, second]  = arr
const arr = [1, 2, 3, 4];

const [first, second] = arr;

console.log(first);
console.log(second);

const person = {
  name: "Pedro",
  age: 20,
};

const { name, age } = person;
console.log(name);
console.log(age);