We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea
ES6 Dynamic Property Names
let city= 'leicester_'; let a = { [ city + 'population' ]: 500000 };
The text was updated successfully, but these errors were encountered:
Great idea! We will keep the same examples when we rewrite the site so we would happily accept a contribution for this 👍 Thanks for the idea!
Sorry, something went wrong.
No branches or pull requests
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' }
The text was updated successfully, but these errors were encountered: