javascript log to console
const varName = 'this variable';
console.log(varName);
javascript log to console
const varName = 'this variable';
console.log(varName);
javascript log to console
console.log('message1' + ' - ' + 'message2')
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);
}
what is console in javascript
var str = "Howdy GeeksforGeeks"
var geek = {
book: "harrypotter",
price: "2000"
};
var geek2 = [10, 20, 30];
console.log(str);
console.dir(str);
console.dir(geek);
console.log("geek (log) = ", geek);
console.dir(geek2);
console.log("geek2 (log) = ", geek2);
// Prints only string as dir() takes
// only one parameter.
console.dir("geek2 (dir) = ", geek2);
javascript console
console.log('log-message'); // Outputs a normal information log to the console window
console.warn('warn-message'); // Outputs warning in the console window
console.error('error-message'); // Outputs error in the console window
console.table('table-message'); // Outputs a table of all the object properties
how to use the javascript console
/*
shortcuts:
command K = clears the console
command shift M = toggle device toolbar
command shift C = select something on the page
you can also log in a variable you may have coded:
x;
[value of x at that moment]
if you're animating something:
noLoop();
[stops the animation]
loop();
[continues the animation]
you can also code somewhat intricate text:
for (var i = 0; i > 10; i++) {
console.log([variable or anything]);
}
some functions are also available to use:
function mousePressed() {
console.log([anything]);
}
function keyPressed() {
noLoop(); [or anything else]
}
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us