-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomework1.js
More file actions
50 lines (41 loc) · 1.05 KB
/
Copy pathhomework1.js
File metadata and controls
50 lines (41 loc) · 1.05 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
/*
Task 1
1.1 Declare two variables: firstName and lastName.
1.2 Assign the value “John” to the variable firstName and the value “Adams” to the variable lastName.
1.3 Print the value of firstName and lastName to the console
(it should show John Adams).
1.4 Use the same variables (overwrite) firstName and lastName to print the new value (Anna Karenina).
The result should be two lines on the screen:
John Adams
Anna Karenina
*/
let firstName = "John";
let lastName = "Adams";
console.log(firstName, lastName);
firstName = "Anna";
lastName = "Karenina";
console.log(firstName, lastName);
/*
Task 2
2 Print the data type of the following variables to the console:
let a,
let c = 9,
let str = “Hi 5!”,
let b = true,
let y = 9 + ‘1’ ,
let x = 'a' / 6
*/
let a;
let c = 9007199254740992;
let str = "Hi 5!";
let b = true;
let y = 9 + '1';
let x = 'a' / 6;
console.log(typeof a);
console.log(typeof c);
console.log(typeof str);
console.log(typeof b);
console.log(typeof y);
console.log(typeof x);
const maxInt = Number.MAX_SAFE_INTEGER
console.log(maxInt)