ES6 features for daily use — 1

Amit Singh
Mar 29 · 1 min read

Object Literal

let playerName = 'Rohit'
let playerTeam = 'mumbaiIndian'
let sampleObj = {
console.log(sampleObj.playerName) => Rohit

Object can created with variables of same name so no need to define complete key value for creating object

Amit Singh

Written by

Manager - Interactive