how to log javascript variable in console code example Example: javascript log to console const varName = 'this variable'; console.log(varName);