Printing a variable in the console. $game_variables not recognised.

I'm trying to read some variables in the console, using the following script command:

console.log("Logging variable 2. Value is " + $game_variables[2]);

On triggering the script, I get 'ReferenceError: $game_variables is not defined".

Having done a little searching, I haven't found another way to access game variables. It seems to be either '\v' in a text window or $game_variables in scripts.
If anybody has any idea how to read the switch states, variables etc. in the console, I'd appreciate your sage advice!
$gameVariables.

$gameVariables.value(index)
Yea, $game_variables is what it was in VX Ace (maybe XP as well).

Also, in case it comes in handy: there's a debug screen available by pressing F9 during playtest. 🙂
Thanks @gstv87 and @caethyril. That $gameVariables.value(index) method works perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/printing-a-variable-in-the-console-game_variables-not-recognised.122228/