The line above is not doing what you think it is doing. arguments is an array-like object containing property/value pairs with the property names such as “0”, “1”, etc… (like indices of an array) and values of the corresponding properties.
The majority of your check function’s logic assumes a single character is passed. Why not just pass a single character (char would become the function’s parameter) to it instead?
Do you understand what the value of i is in each iteration of the for loop? If no, I suggest adding a simple console.log(i) to find out. I think you will be surprised.
Two more things:
Currently, you are returning the original string passed to the function. Is that what you want to do?
2.You are also missing a conversion specified in the instructions.