Skip to content
Advertisement

JQUERY for loop not outputting integers within the array

I tried this code below but the logged output of the loop is coming up as 3649 which are not id numbers in the array being passed. Even when adding more ids or subtracting ids from the array, it does not change the output of the ajax code.

I have confirmed the array is being received properly by the function below by using a console.log(id). This verifies the output as below:

The array as being passed:

JavaScript

What might I be doing wrong?

JavaScript

If I console.log(id); I get 3649 which isn’t even in the array

Advertisement

Answer

You’re missing a curly brace. Try:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement