Javascript – calling a function with parameters [closed]

I am doing some POC on a javascript code below which is calling another function with parameters.

When i remove the parameters and hard code the value in the function ResendDeadletterToMain(), it works fine.

however when i send the parameters from the calling function it errors out with the below error.

ReferenceError: error is not defined
at ResendDeadletterToMain ((index):213:28)
at HTMLAnchorElement.onclick ((index):1:1)

Code that doesnot work

Code that works

My question is then how we can pass the parameters in this case ?

How can we pass the parameters in this case ?