My array gameVariable is incompatible with my code for some reason (Involves alot of JS)

My game variable for reference:
$gameVariables.setValue(88, [2,1,2,2,1,2,3,1,1,1,4,2,3,3,2,3,3,5,1,5,5,5,3,4,3,3,3,4,4,5,5,5,4,4,5,4,4,5,5,1,4,3,4,2,5,4,1,2,4]);
This is my code, for some reason when I try an plug in my game variable into the code below the game crashes, but if i replace it with "const array = [[2,1,2,2,1,2,3,1,1,1,4,...]" it works just fine, does anyone know how I could work around this issue?

My game event thats buggin out:
const indices = [];

let idx = $gameVaruables.value(88).indexOf(5);

while (idx !== -1) {

indices.push(idx);

idx = $gameVaruables.value(88).indexOf(5, idx + 1);

}

console.log(indices);
You have $gameVaruables and it needs to be $gameVariables

Like this:
JavaScript:
const indices = [];
let idx = $gameVariables.value(88).indexOf(5);

while (idx !== -1) {
    indices.push(idx);
    idx = $gameVariables.value(88).indexOf(5, idx + 1);
}

console.log(indices);
You have $gameVaruables and it needs to be $gameVariables

Like this:
JavaScript:
const indices = [];
let idx = $gameVariables.value(88).indexOf(5);

while (idx !== -1) {
    indices.push(idx);
    idx = $gameVariables.value(88).indexOf(5, idx + 1);
}

console.log(indices);
God i feel like such an idiot, thank you so much dude
God i feel like such an idiot, thank you so much dude
No problem. If you aren't already, consider writing your scripts in an actual code editor (for JavaScript, I recommend Visual Studio Code). It'll be easier to spot simple mistakes when the code has syntax highlighting and is properly formatted.

Original thread: https://forums.rpgmakerweb.com/threads/my-array-gamevariable-is-incompatible-with-my-code-for-some-reason-involves-alot-of-js.151436/