how to declare object variable by default value in javascript code example Example: variable defaults javascript es6 let variableToSet = checkedValue || defaultValue;