print console javascript code example

Example 1: how to print to console javascript

console.log("string")

Example 2: javascript log to console

const varName = 'this variable';

console.log(varName);

Example 3: javascript log to console

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

Example 4: how to use js console log

console.log('string');

Example 5: how to print console in javascript

console.log("message here")

Example 6: get console javascript

//What you can do is hook the console.log function so that you store when it logs :
console.stdlog = console.log.bind(console);
console.logs = [];
console.log = function(){
    console.logs.push(Array.from(arguments));
    console.stdlog.apply(console, arguments);
}