const customer = {name: "taro", age: 22};
const {name, age} = customer;
console.log(name);
console.log(age);
// output
// taro
// 22
const name = "taro";
const age = 22;
console.log({name,age});
// output
// { name: 'taro', age: 22 }
Go to list of users who liked
More than 3 years have passed since last update.
const customer = {name: "taro", age: 22};
const {name, age} = customer;
console.log(name);
console.log(age);
// output
// taro
// 22
const name = "taro";
const age = 22;
console.log({name,age});
// output
// { name: 'taro', age: 22 }
Register as a new user and use Qiita more conveniently
Go to list of users who liked