"Type error:Not a function" I cannot figure it out

I am trying to detect if the user id is already in a table and return false if it is

But whenever I try to run the program it says that it thinks it is a function and the whole project comes to a halt

I haven’t tried anything yet because I just don’t know where to start

1 Like

your using that call on an Array object datatype, arrays do not include such a prototype function while strings do. By using .join in your current line we can easily convert it to a string I’ll show your new modified line you should be using

if (!userids.join(" ").includes(getUserId())) {

in which join gets executed first along with the seperating spaces depending on preference i just did it to avoid the possibility of a mismatch since your using includes

2 Likes

Hi @milnedan001, thank you so much for posting to the forum and @varrience for providing the troubleshooting! @milnedan001 if you could reply back and let us know if that solved your issue that would be much appreciated. Also, if you need additional guidance with this or any other app lab project be sure to also tag CSP since they use app lab and JavaScript.

Best,
-Sam

Thank you very much, This worked flawlessly