DEV Community

Discussion on: July 8th, 2021: What did you learn this week?

Collapse
mergerg profile image
Raphael • Edited on

This week I learned that you can assign object properties to String variables in JavaScript! Eg, instead of doing "object.name = name" you can do
"let var = 'name';
object[var] = name"
and it'll result in the same thing! Obviously this example is kind of useless but I used this information to basically make an easier-to-assign-to map out of an object with user-defined file names as keys!

Collapse
nickytonline profile image
Nick Taylor Author

Bobby Moynahan character from SNL saying awesome!