-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.Introduction.js
More file actions
103 lines (76 loc) · 3.28 KB
/
1.Introduction.js
File metadata and controls
103 lines (76 loc) · 3.28 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//1.Introduction:
document.write("Verstile,high level programming lang and one of the core technology of the world wide web.")
document.write("primary used to make website intractive and dynamic.")
document.write("invented by Brendan Eich in 1995.")
document.write("developed by Netscape")
document.write("JavaScript vs VBScript (Microsoft)")
document.write("-js is modern cross platform standard for web development, VBScript: in contrast is an older Microsoft-developed scripting language thet is being officially deprecated in favor of js and powershell.")
document.write("js supports all browser, vbscripts, supports IE")
document.write("Originally Sun Microsoft and now Oracle")
//2.why it is important:
document.write("it allow developers to add logic and interactivity to websites.")
//example:
document.write("-Form validation")
document.write("Dynamic content updates")
document.write("API Calls")
document.write("Event handling")
//relationship with html and css
document.write("html-structure,css-design,js-behavior/logic")
//3.how js run (browser/node basics)
document.write("javascript need an environment to run it cannot run by itself like other program.")
document.write("two main environment runs javascript:")
document.write("1.Browser")
document.write("2.Node.js")
//javascript in Browser
document.write("when we open any website the work goes like this htmk-css-js")
document.write("browser like chrome,firefox,edge containe a javascript engine.")
document.write("chrome: V8 Engine")
document.write("the engine read and execute javascript code")
//example code
//<script>
//document.write("hello")
//</script>
//4.js engine
document.write("javascript engine: ")
document.write("js engine is a programs that understand js code and run it.")
document.write("chrome-v8 engine")
document.write("firebox: SPIDERMONKEY")
//WHAT'S THE WORKFLOW:
document.write("jscode->environment(chrome/firefox)->jsengine->output")
document.write("js code-js engine-machine code-output")
//js outside the browser:
document.write("earial js runs only inside the browser, but now we have node js ")
document.write("node js allow js to run outside the browser,run on our pc/server")
//for example:
//file name is name.js
document.write("hello from node js")
//to run this write in terminal..node name.js
document.write("js can build server,api,backend system.")
//5.Browser
document.write("run js for webpages and allows DOM INTERACTION.")
//6.node.js
document.write("Runs javascript outside the browser and is used for backend development.")
//basics:
//1,first programe
let a=10;
let b=20;
let c=a+b;
document.write(c);//30
//comments:
//-for single line
/* ....*///for multiple line
/*
let name='beauty'; */
// let age=21;
// document.write(name)
//printing using backticks:
let n=2;
let s='price of an apple is ${n}';
document.write(s)
//also called template literals..try multiple
// Key Features of JavaScript
// Client-Side Scripting: Runs in the browser for faster response times (no server lag).
// Versatile: Handles everything from basic math to complex server-side apps.
// Event-Driven: Reacts instantly to user actions like clicks or typing.
// Asynchronous: Processes data in the background without freezing the UI
// Rich Ecosystem: Access to powerful libraries/frameworks (React, Angular, Vue) for faster builds