Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

console.log

console.log('zama')
Comment

console.log

// In addition to TopHacker's answer 
console.assert(/** Condition **/, /** Error message **/); 
console.trace(); 
debugger; // will force execution halt at the line where this is written allowing code inspection 


Comment

console log

var a=10;
var b=20;
console.log(a);
// Expected output: 10
console.log(b);
// Expected output: 20
console.log(a,b);
// Expected output: 10 20
Comment

console log

//how to see js output in browser console
//string 
console.log("hello"); // hello 

//number 
console.log(125); //125

//variable 
let val = "Hi! I am a shahjalal";
console.log(val) // Hi! I am shahjalal
Comment

console.log

console.log(69)
Comment

console.log

console.log("dale")
Comment

console.log

console.log('Hi there!');
// Prints: Hi there!
Comment

console.log

//return something in the console
console.log(string);

//return something in the console marked as an error
console.error(string);

//return something in the console marked as a warning
console.warn(string);

//return something in the console in a table
console.table([{json strings}];

//clear the console
console.clear();
Comment

console.log

console.log("");
Comment

console.log

console.log(10); // Integer
console.log(true); // Boolean
console.log('String'); // String
Comment

console.log

// console.log("") is usefull for a lot of things

const myNumberOne = 69;
const myNumberTwo = 420;

console.log(myNumberOne + myNumberTwo);

// Example 2

let x = 4;
let y = 2;

console.log(`The difference between x and y is ${x - y}!`)
Comment

console.log

console.log("Hello, world.");
// Hello, world.

let num = 5;
console.log(num);
// 5
Comment

console.log() Syntax

console.log(message);
Comment

JavaScript console.log()

let sum = 44;
console.log(sum);   // 44
Comment

console.log

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

what is console.log?

console.log('Testing console');
Comment

console log

VS CODE JavaScript (ES6) code snippets:
clg ==> console.log(object);
clo ==> console.log('object :', object);
ccl ==> console.clear(object);
cer ==> console.error(object);
ctr ==> console.trace(object);
clt ==> console.table(object);
cin ==> console.info(object);
cco ==> console.count(label);
Comment

how to log to the console

console.log("something");
// you can just write (log) in vs code and press enter it will automaticly write (console.log())
Comment

console log

CONSOLE LOG LIKE A PRO:
Put {} to have label value pairs
// e.g console.log({data, name}); returns data: data, name: name

Console.table() puts data in table!

Console.group() ... console.groupEnd() //groups console logs inside these together 

Console.assert only logs if first param falsey!

Console.count keeps track!

console.time and console.timeLog / timeend outputs how long took.

%c first char in string to add custom css:)
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert json object to lowercase 
Javascript :: .fetch method 
Javascript :: remove spaces from string javascript 
Javascript :: javascript find object in array and replace it 
Javascript :: how to update node in terminal 
Javascript :: react hide element 
Javascript :: load youtube iframe player api 
Javascript :: xlsx to csv javascript 
Javascript :: How to make HTML input tag only accept numerical values? in jsx 
Javascript :: handlebarsjs each first element 
Javascript :: model mongoose 
Javascript :: use font awsome in react 
Javascript :: javascript auto scroll horizontal 
Javascript :: operators in javascript 
Javascript :: javascript select element with two classes 
Javascript :: async foreach 
Javascript :: javascript get current window location without parameters 
Javascript :: nan javascript 
Javascript :: javascript get character from string 
Javascript :: react native font awesome 
Javascript :: load external javascript from console 
Javascript :: react cdn 
Javascript :: put new attribute on html tag using javascript 
Javascript :: javascript statement 
Javascript :: scrollintoview javascript 
Javascript :: how to import npm module 
Javascript :: github remote 
Javascript :: new line in rdlc expression 
Javascript :: how to read json file with file input html 
Javascript :: child_process npm 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =