boolean or string check javascript code example Example: js is boolean if (typeof variable === "boolean"){ // variable is a boolean }