-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass12.html
More file actions
59 lines (55 loc) · 1.6 KB
/
class12.html
File metadata and controls
59 lines (55 loc) · 1.6 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
52
53
54
55
56
57
58
59
<!-- js : cross side platform,object oriented scripting language,contains many library -->
<!-- use script tags -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript</title>
</head>
<body>
<div align="center">
<h1>Learning JavaScript</h1>
</div>
<!-- implementing js -->
<script>
//variable:store a data,var is a keyword for variable
var num1=3265
var num2=235.44
// To print data in main document
document.write(num1)
// visible in console
console.log(num1+num2)
// let keyword
let name ="Alwina"
console.log("My first love",name)
const city ="Disney"
console.log(city)
// Functional scope
console.log("Work assigned")
console.log("Work Completed")
//function-> set of code that will execute whenever it is called
// function first()
// {
// for (let i=0;i<3;i++)
// {
// console.log("Work assigned")
// console.log("Work Completed")
// }
// }
function first(to,by)
{
console.log("Work assigned to",to)
console.log("Work completed by",by)
}
function add()
{
console.log(num1+num2)
}
first("Tom","aLLU")
add()
// first()
</script>
</body>
</html>