Js function declaration form

problem description

when looking at other people"s project code, I found that there is still such a way to declare a function, and it is also very interesting in the way it is called. It can be called with variables and corresponding numbers with variables. What is this writing and why can it be used? [variable] is this form unique to the object? when I printed the test object, I found that the object had a key name, that is, "0, 1, 2", and each key corresponds to a function

.

related codes

clipboard.png

clipboard.png

Jul.07,2021

the new syntax of ES6 (sugar).

 -sharp calculation attribute name 
 
					
Menu