Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
Comment

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);
Comment

javascript console

// our string
let string = 'ABCDEFG';

// splits every letter in string into an item in our array
let newArray = string.split('');

console.log(newArray);
Comment

js console

   this is the console
Comment

js console

console.log("Text"); //Shows some text in the console.
console.warn("Warning!"); //Displays a Warning in the console
console.error("Error!"); //Displays an Error in the console.

//Example (On Value Displays)
var Value = 69;
console.log(Value); //Displays '69' in the console.
console.log("The Value Is " + Value + "!"); //Displays 'The Value Is 69!' in the console.
Comment

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]
}

*/
Comment

PREVIOUS NEXT
Code Example
Javascript :: disable button in angular 
Javascript :: js unique string array 
Javascript :: how to check if a key exists in an object javascript 
Javascript :: typescript react handle change 
Javascript :: innertext javascript 
Javascript :: react onclick runs on load 
Javascript :: express post not working 
Javascript :: how to get first and last element of array in javascript 
Javascript :: Example: Export a Variable in Node 
Javascript :: js push array to array 
Javascript :: js wait until 2 promises are resolved 
Javascript :: 100vh mobile 
Javascript :: Error: "line" is not a registered controller 
Javascript :: how to clone an object 
Javascript :: ajax post form listener button 
Javascript :: javascript get fibonacci number 
Javascript :: Error: ENOENT: no such file or directory, mkdir 
Javascript :: javascript crash course 
Javascript :: javascript hide elements by class 
Javascript :: getelementbyid js 
Javascript :: usecontext hook react 
Javascript :: javascript lowest number 
Javascript :: javascript foreach loop 
Javascript :: how to compare arrays in js 
Javascript :: convert form data request to json laravel 
Javascript :: how to change html element in javascript 
Javascript :: deprecationwarning: mongoose 
Javascript :: slice string js 
Javascript :: redirect to website from promise value fetch 
Javascript :: twilio sms sending in express 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =