Function declaration syntax i don't understand


I’m looking at a JavaScript code that has a function with the following syntax:

function validate_mod_resource_mod_form_reference[value](element) {

you see the “[value]” there? is that valid?

Where did you see this been done as there is no way you use an array reference on a function that’s not a prototype of the Object family

It would be interesting to see a line of code where that “function” is actually called.

You wouldn’t even be able to call the function because an error would be thrown when declaring the function.

That’s what I thought as well and hence my curiosity to see how the function was even called in the op’s code since he/she said

I’m looking at a JavaScript code…