Conditional branches with switches and variables

"If GameSwitch[101] is ON then DO:"

or

"If GameVariable[10] == 100 then DO:"

How can I do that in javascript? I'm trying to script a plugin but this point get me stuck. 🙁
Code:
if($gameSwitches.value(101)){
    'Code Here'
}
if($gameVariables.value(10) === 100){
    'Code Here'
}
Thank you!!!!!!!!!!!!!!

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branches-with-switches-and-variables.89270/