consol log code example

Example 1: javascript log to console

const varName = 'this variable';

console.log(varName);

Example 2: javascript log to console

console.log('message1' + ' - ' + 'message2')

Example 3: how to use js console log

console.log('string');

Example 4: js log to console

console.log('this string will show on console') // this string will show on console

const strVar1 = 'fizz';
const strVar2 = 'buzz';

console.log('strVar1 is: ' + strVar1 + ' and strVar2 is: ' + strVar2) // strVar1 is: fizz and strVar2 is: buzz
console.log(420) // 420

Example 5: console.log

console.log("");

Tags:

Java Example