-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday1basics.js
79 lines (66 loc) · 1.29 KB
/
day1basics.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
// var someVar = "This is a string";
// alert(someVar);
// someVar = 10;
// alert(someVar);
// someVar = 10.5;
// alert(someVar);
// someVar = new Object();
// alert(someVar);
var sampleStr = "This is Tiki's string";
sampleStr = 'This is also Tiki\'s string';
var num = 10;
// alert("The value you specified is: " + num);
var x=10, y=5;
/*
RELATIONAL OPERATORS:
== / === Same as memory address/ Same as value
!= / !== Not same as memory address / Not same as value
< , <= , > , >=
LOGICAL OPERATORS:
&& And
|| Or
! Not
*/
// if(x != y && x > 100 || y <100)
// {
// alert("TRUE");
// }
// else
// {
// alert("FALSE");
// }
// var userInput = prompt("Enter something")
// switch(userInput)
// {
// case "Hello": alert("Greetings");
// break;
// case 'Bye': alert("Goodbye");
// break;
// case "What": alert("Whatever");
// break;
// default: alert("Invalid entry");
// }
/*
while
do while
for
*/
function doSomething(param1)
{
console.log("Day1 doing something");
}
var counter = 0;
for(var i = 0; i < 3; i++,console.log("Let's do this"));
// {
// console.log("Salam");
// counter++;
// }
// do{
// console.log("Moi");
// counter++;
// }while(counter < 5);
// while(counter < 5)
// {
// console.log("Hello");
// counter ++;
// }