Assign Const Value in JavaScript

Published on Mar 16, 2022

You can easily assign any const value in JavaScript without called each value.

const user = {
  name: 'imnhasan',
  email: '[email protected]'
}
// instead if this
const name = user.name;
const email = user.email;

// you can use this
const {name, email} = user;