I am trying to run a function in my JavaScript code. I'm trying to create two arrays, one with arabic words and one with the translated words in english, where corresponding words in each array have the same index. The purpose of the function is so that I can add an arabic word and its translation simultaneously.
The function doesn't run when I call it, and I have determined that the fact I am passing parameters in the function is what's causing it to not run. Why does this happen and how can I get the function to run? The script is in the <body> of the HTML.
This is my code:
var arabic = [];
var english = [];
function addToArrays(arabic, english) {
arabic.push(arabic);
english.push(english);
}
addToArrays("string1", "string2");