0
What actually is Computed Property names?
Hello! I want to know details about Computed property names and in what type of application we can use this thing?
2 Antworten
+ 3
Oh. Okay. Computed property names are usually enclosed in square brackets.
var obj = {
['a'.repeat(5)]: 'hello'
}
It will be referenced like this:
obj.aaaaa // hello
Or
obj['aaaaa'] // hello
Or
obj['a'.repeat(5)] // hello
0
No! I am asking in JavaScript