Skip to content

Add 'Dynamic Property Names' to 'ES2015 (ES6) Examples' section in 'Select Example' drop down #2

@patelg123

Description

@patelg123

Type of issue

Idea

Description (include any screenshots or debugging information if applicable)

ES6 Dynamic Property Names

Allows the ability to create or add properties with dynamically assigned keys:

let city= 'leicester_';
let a = {
[ city + 'population' ]: 500000
};

a[ city + 'county' ] = 'Leicestershire';
console.log(a); // {leicester_population: 350000, leicester_county: 'Leicestershire' }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions