-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.js
86 lines (32 loc) · 2.55 KB
/
main.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//JavaScript ata types
//Please CHECK the README.md for more EXPLANATIONS and DO THE EXERCISES that are done there too.
// TRY OUT THIS CODE, TYPE THEM AND PRINT, CHANGE THERE VALUES AND PRINT, CREATE NEW VALUES ADD VALUES AND PRINT.
//string data type
const firstName = "Jane"; //we are using const for constant, because the value firstname can not change.
let lastname = 'Doe'; // using single quotes, and value can be changed because we are using let
// to define the variable.
lastname = 'Smith'; //Jane is married and her lastname is changed, because we used let,
//we can re-assign a new value in the lastname variable, because of let.
// let it be this now, later we can change it. thats what it means
//Boolean data type
const isJaneMarried = true // see that we did not wrap the true with a quotation symbol.
const itChangedBecauseOfLet = true; //because we used let in lastname variable, we could change the value
// to another string value.Your variables can be long too, but please make them short and precised.
const canItChangeWithConst = false; //no we cant change the he data type of the value boolean stored
//with const to a different data type like number iside the variable.
const isItTrue = true; //booleans have either a true or false value and are mostly used with logical operators
//remember the true or faluse is in small letters and are not wrapped with quotation marks, just like strings.
//if you wrap the booleans with quotation mark you will get a string value stored.
//number data type
let age = 45; //we are using let here, because the value of thevariable ca change.
// ASSIGNMENT
//Please follow insructions.
//create the variables
//print out your values.
// 1. Create a variable firstname, lastname and email, given it the value of string.Your fristname, lastname and email address.
//2. Create a variable of number given it the value of your age.
//3. Create a variable iAmLearningJavaScript and give it a boolean value of true.
//Advanced question, please do attempt them, make research and solve it.
//4. Create a variable name called sentence and assign it a value of the concatenation of the other variables, making a sentence with it.
//hint: "My name is Kennedy Chukwu, I am 15 years old and it's true am learning Javascript".
//HAPPY CODING...