If variable = 1 statement

How can I write in a plugin the statement

if game variable X = 1 ?
https://developer.mozilla.org/en-US/docs/Learn/JavaScript

Double or triple equals is "equals," single equals is "assign to"

Code:
var myVariable = 1;

if (myVariable == 1) {
  console.log('OH HI MARK');
} else {
  console.log('OH BAI MARK');
}

would log "OH HI MARK"
"==" is for comparison.
"===" is for strict comparison.

(X == true) returs true if X is number, string or anything besides nil, 0 or false.
(X === true) returns true only if X is true, and false if anything else.

Original thread: https://forums.rpgmakerweb.com/threads/if-variable-1-statement.89156/