I have implemented successfully JavascriptExecutor but I want to know why we take this array "arguments[0]"?
Here is the code below:
IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;
executor.ExecuteScript("arguments[0].click();", driver.FindElement(locator));
driver.FindElement(locator)produces. So,arguments[0]is your way of accessing the first argument to the anonymous function.