It looks like that the problem begins with the fact that you’re calling myArray.split(). The split() method isn’t an Array method, it’s a string method. In fact, I don’t think you even need to create the variable myArray, your function already has a variable called str that you can use. It’s one of the arguments you set for your function. str should be a string that has the split() method.
Try changing var myArraySplit = myArray.split(" “); to var myArraySplit = str.split(” ");
Also, double check your for loop. There’s a comma that doesn’t belong there, and a semi colon at the end that shouldn’t be there. (Turn the comma into a semi-colon and get rid of the semi-colon at before the closing parenthesis.)
Hopefully this helps!