0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Add a Dynamic Property

Bracket notation can also add or update a property when its name comes from a variable.

Example

const player = { name: "Leo" }; const propertyName = "score"; player[propertyName] = 10;

Your task

Use the supplied property name and value to add role: admin to account. Then display Role: admin.