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