console log meaning code example

Example 1: Console.log

//Console.log is a way to send a message to the console.
//by typing console.log("") then putting text inside the quotation marks.

Console.log("Hello World!")

//pr of your using a varible you don't use the quotation marks.

var Varible = "Hello World!"
Console.log(Varible)

//You can use console.log for many uses like sending info about Errors.

Example 2: 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 3: console.log

var players = ['Jim', 'Shawna', 'Andrew', 'Lora', 'Aimee', 'Nick'];
console.log(players);

Tags:

Java Example