A parameter is just a type of variable. If you want to be super duper pedantic, a variable is created to hold the value of the parameter passed into the function. My comment still applies… You can’t use dot notation here.
As said a parameter is a variable, you can tell by how it works. When you call the function you pass it an argument (value) and it gets assigned to the parameter (variable).
For dot notation to work when accessing a property, it has to exist on the object. There is no id property on the object. You can not read the value of the property id because it doesn’t exist on the object.
The variable (parameter) has to be evaluated (read), and its value used, as the property name (key). So whatever the parameter contains (the value passed as an argument) must be inside brackets.