-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path02-console.js
38 lines (31 loc) · 945 Bytes
/
02-console.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* ******************************
* Using the Console
* ******************************
*/
// Single line comment.
/*
Multi
line
comments
*/
// Log to console
console.log('Hello World!'); // string
console.log(123); // number
console.log(true); // boolean
var greeting = 'Hello';
console.log(greeting); // variable
console.log([1, 2, 3, 4]); // arrays
console.log({ a: 1, b: 2 }); // objects
console.table({ a: 1, b: 2 }); // objects into table
console.error('Ths is an error!'); // error message
console.clear(); // clear the console
console.warn('This is a warning!'); // warning message
// Check the time it takes to log to the console
console.time('Time');
console.log('Hello World!');
console.log('Hello World!');
console.log('Hello World!');
console.log('Hello World!');
console.log('Hello World!');
console.timeEnd('Time');