logo logo
  • Articles
  • Snippets
  • Topics
    • Login
    • Register

    • Mode:

Assign Const Value in JavaScript

  • Mar 16, 2022
  • Snippet ยท 1 min
  • 64 words
  • Share profile in a message
  • Save your profile to PDF
  • Lock profile

  • Profile settings
  • Like (0)
  • Favorite (0)

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;

JavaScript
avatar
Md Najmul Hasan

Similar Stories

JavaScript What is encodeURI() Function and How it Works

snippet

JavaScript Check Value is Undefined

snippet

Javascript Check a Number is Even

snippet

How to Use Sleep in Javascript

snippet

Javascript Make an HTTP Request

snippet
Random Stories

How to copy past data from clipboard in windows to virtual box Linux

snippet

Install SSH Into a VirtualBox Ubuntu Server

snippet

Two way to upload file in Laravel

snippet

Getting error to install php artisan ui react --auth for Laravel react ui the error is Could not resolve dependency: peer vite@"^3.0.0" from @vitejs/[email protected]

snippet

Run one migration in Laravel

snippet