Checking if a switch is ON in a script

Very surprised I haven't see this question yet.
I've mostly seen the answer to how to use SetValue in a script to set a switch to true or false.

I want to check if my switch (ID = 269) is ON.

This doesn't seem to work.

if ($gameSwitches.Value[269])
{
//code if switch 269 is ON
}

What is the correct way write an IF command using the $gameSwitches?
Thanks!
PHP:
$gameSwitches.value(269)

You'll find that value is a function, not an array/object. Also value needs to be lowercase. Your thing is returning undefined.

I just learned that using the console to auto type it.

Don't worry. It happens to the best of us.
Thanks mogwai, that is indeed the case. 🙂
//facepalm

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-a-switch-is-on-in-a-script.75117/