-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (43 loc) · 1.3 KB
/
index.html
File metadata and controls
51 lines (43 loc) · 1.3 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
51
<!DOCTYPE html>
<html>
<head>
<title>Learn JavaScript</title>
<script>
//alert('Hello World');
var firstname = 'John';
var lastname = 'Doe';
//alert('Hi my full name is: ' + firstname + ' '+ lastname);
if(firstname == 'John'){
//alert('Yes Im John');
}else if(firstname == 'Steve'){
//alert('Yes Im Steve');
}
else{
//alert('No Im not John');
}
//Creating array
var cars = new Array();
//cars[0] = 'Camaro';
//cars[1] = 'Mustang';
//cars[2] = 'Genesis';
//or
cars = ['Camaro','Mustang','Genesis']
//looping through arrays
for(var i=0;i< cars.length;i++){
//console.log(cars[i]);
}
//alert(cars[1]);
function sayHi(word){
//alert(word);
}
//sayHi('Hello');
function addIt(num1,num2){
alert(num1 + num2);
}
//addIt(3,5);
</script>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>