es6 check if variable exisits code example Example: javascript check if variable exists if (typeof myVar !== 'undefined') { // myVar is defined }