Today's Javascript Tip: Dynamic Object Keys
MOHAMED MOUROUH

MOHAMED MOUROUH @mmourouh

About: Hi 👋, I'm a software engineer. I turn ideas into a stunning digital reality.

Location:
CASABLANCA , MOROCCO
Joined:
Jun 6, 2020

Today's Javascript Tip: Dynamic Object Keys

Publish Date: Aug 26 '24
0 3

This technique allows us to create object properties dynamically.

Comments 3 total

  • NameSilo
    NameSiloAug 27, 2024

    Great!

  • Alex Mustiere
    Alex MustiereAug 27, 2024

    You can also use

    const user = {};
    user[[key]] = 'Alice';
    
    Enter fullscreen mode Exit fullscreen mode
Add comment