JavaScript Introduction
What is JavaScript?
1. JavaScript is the programming language of the web.
2. It can update and change both HTML and CSS.
3. It can calculate, manipulate and validate data.
Why Study JavaScript?
JavaScript is one of the 3 languages all web developers
must learn:
1. HTML to define the content of web pages
2. CSS to specify the layout of web pages
3. JavaScript to program the behavior of web pages.
JavaScript Where To..
In HTML, JavaScript code is inserted between <script>
and </script> tags.
Example:-
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript in Body</h2>
<p id="demo"></p>
<script>
[Link]("demo").innerHTML = "My First
JavaScript";
</script>
</body>
</html>
JavaScript Variables:-
JavaScript Variables can be declared in 4 ways:
• Automatically
• Using var
• using let
• using const
JavaScript Operators
The Assignment Operator = assigns values
The Addition Operator + adds values
The Multiplication Operator * multiplies values
The Comparison Operator > compares values
• ThArithmetic Operators
• Assignment Operators
• Comparison Operators
• String Operators
• Logical Operators
• Bitwise Operators
• Ternary Operators