How to ask for a self switch outside of the associated event

I want ask for a self switch of an specific event, but outside of it. I'm about streamlining a certain process so that would be pretty useful.

I want to do it via a javascript call, but I have no Idea how to ask for a self switch.
I only know in the rpg-maker VX you could type:
$game_self_switches[[24, 14, 2]] = 'true'
to set self switches true, but it doesn't work in MV. So how goes the if term?

I want to know if Self switch 2 from Event 14 on Map 24 is true.

Something like that:
if ($game_self_switches[[24, 14, 2]]) == 'true'?
It's $gameSelfSwitches.setValue([map, event, 'selfswitch'], value) where value = true/false.

Self switches don't have numerical values, just A-D. I'll assume for your example it'd be Self Switch B, so you'd put $gameSelfSwitches.setValue([24, 14, 'B'], true) inside a script call. ☺️
Thanks for the help, but somehow I can't implement it as an conditional branch I thought it would be right when I type the following: if($gameSelfSwitches.Value([24, 14, 'B']) == 'true')

But the syntax doesn't seem right the game crashes.
To use it in a conditional branch you write $gameSelfSwitches.value([map, event, 'selfswitch']) which will give you true/false. E.g. Using if $gameSelfSwitches.value([24, 14, 'B']) would show when it's ON, and if there's an else branch it'll be shown when the switch is off.
Vielen Dank!

That helped me a lot, syntax can be pretty nifty sometimes.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-ask-for-a-self-switch-outside-of-the-associated-event.85072/