Driver.exeuteScript with arguments not working

I have the following code

js.executeScript(“function scrolling() {”
+ “var el = target.frontMostApp().mainWindow().scrollViews()[0];”
+ “if (arguments[0] == ‘left’){”
+ “el.scrollLeft();}”
+ “else{”
+ “el.scrollRight(); return arguments[0];}”
+ “}”
+ “scrolling();” , direction);

arguments[0] returns an empty string. Is there something I am doing wrong here? this code will not enter the if statement because arguments[0] is always empty