0% found this document useful (0 votes)
2 views

myNotes

The document provides an overview of HTML and JavaScript, detailing their definitions, structures, and key concepts. It explains HTML as the markup language for web pages and JavaScript as a programming language for creating interactive web applications. Additionally, it covers various JavaScript topics including variables, data types, control flow, functions, and error handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

myNotes

The document provides an overview of HTML and JavaScript, detailing their definitions, structures, and key concepts. It explains HTML as the markup language for web pages and JavaScript as a programming language for creating interactive web applications. Additionally, it covers various JavaScript topics including variables, data types, control flow, functions, and error handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

HTML:- HTML stands for Hyper Text Markup Language.

It is used to design/create the


structure of a webpage.

The collection of static web pages are called a website.

The collection of Dynamic webpages are called web application.

__Smallest Unit of HTML is tag:-

tag - anything written in </> angular brackets are called tag


eg - <tagname></tagname>, <tagname/>
Types of tag-
there are two types of tag:-
1. Container Tag == <tagname>----anym text/tag-----</tagname>
2. Self Closing Tag(Empty Tag) --->> <tagname/>

Basic Structure(Syntax) of HTML webpage


<html>
<head></head>
<body>
Hello World!
</body>
</html>

<html></html> ->
html tag is a container tag and it is the root element(tag) of a HTML file.

<head></head>
head tag is also a container. head tag contains metadata of the html file.

<body></body>
body tag is also a container tag. all visualized part in web browser
are written inside the body tag

Tags of head Tag : -


1. title
2. style
3. script
4. NoScript
5. link
6. meta
7. base
8. command

1. HTML
WHAT IS HTML?
HISTORY OF HTML?
2. CSS
WHAT IS CSS?
2. WEBSITE & WEB APPLICATION
3. TAG, ELEMENT, ATTRIBUTE
4. BASIC STRUCTURE
5. TAG OF HEAD TAG
6. TITLE, STYLE, SCRIPT, NOSCRIPT

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++

============================================================

---

1. Introduction to JavaScript
- What is JavaScript?
- Role of JavaScript in web development
- Setting up a development environment (Browser Console, VS Code, Node.js)
- Writing your first JavaScript program

1. What is JavaScript?
Ans -> JavaScript is the programming language of the web.
It can update and change both HTML and CSS.
It can calculate, manipulate and validate data.

OR

JavaScript (JS) is a programming language used to create interactive web


pages and applications. It's a lightweight, cross-platform language(run on
multiple OS) that can be used on the client-side and
server-side.

Think of it like this:


1. HTML is the structure of a webpage (like the walls of a house).
2. CSS is the design (like paint and decorations).
3. JavaScript is the action (like doors opening, lights turning on, or a TV
playing a video)

Key Aspects of JavaScript as a Programming Language:-


1. Scripting Language –
JavaScript is primarily used for scripting, meaning it runs inside another
environment (like a web
browser) rather than being compiled into machine code.

2. General-Purpose –
While it started as a web language, it is now used for backend development,
mobile apps,
and even AI applications.

3. Turing Complete –
JavaScript can simulate a Turing machine, meaning it can perform any
computation that any other
programming language can.

Common Uses of JavaScript in Programming:


1. Frontend Development (e.g., React.js, Vue.js, Angular)
2. Backend Development (e.g., Node.js)
3. Game Development (e.g., Phaser.js)
4. Desktop Applications (e.g., Electron.js)
5. AI & Data Science (e.g., TensorFlow.js)

===================================================================
---

2. JavaScript Basics
- Variables (var, let, const)
- let vs const vs var
- Data Types (String, Number, Boolean, Null, Undefined, Object, Symbol,
BigInt)
- Operators (Arithmetic, Comparison, Logical, Assignment, etc.)
- Type Conversion

---

3. Control Flow and Loops


- Conditional Statements (if, else if, else, switch)
- Loops (for, while, do-while)
- Loop control (break, continue)

---

7. DOM Manipulation
- Selecting Elements (getElementById, querySelector, etc.)
- Changing Content and Attributes
- Adding and Removing Elements
- Event Listeners (click, mouseover, keydown, etc.)

4. Functions
- Function Declaration vs Function Expression
- Arrow Functions (=>)
- Function Parameters & Return Values
- Callback Functions

-Type of Functions
1. Named Function -
2. Anonymous Function - A function without a name, usually assigned to a
variable.
3. Arrow Function (ES6+) : - A shorter syntax for writing functions.
4. Immediately Invoked Function Expression (IIFE) : - A function that runs
immediately after it is defined.
5. Constructor Function - Used to create objects.
6. Callback Function - A function passed as an argument to another function.
7. Async Function (ES8+) - A function that uses async and await for handling
asynchronous operations.

---

5. JavaScript Objects
- Object Literals
- Accessing and Modifying Object Properties
---

6. Arrays in JavaScript
- Creating and Accessing Arrays
- Common Methods (push(), pop(), shift(), unshift(), splice(), slice(),
map(), filter(), reduce(), etc.)
- Iterating Over Arrays (forEach(), map())
---

8. Advanced JavaScript Concepts


- Scope (Global, Local, Block)
- Asynchronous JavaScript (setTimeout(), setInterval(), Callbacks)

---

12. Error Handling in JavaScript


- try...catch...finally
- Throwing Custom Errors

=======================================================================\
JS:- JS stands for JavaScript, JavaScript was created in 1995 by sir Brendan Eich.
JavaScript is High-level, Dynamic and interpreted programming language.
JavaScript is a client side and also server side scripting language.
JavaScript follows camel format.
It is used to create dynamic web pages and is also used for validation.

The First name of JS was Mocha and second was Live-Script and Last & Current name
is JavaScript.

Some important things in JS


1. Function
2. Event
3. Boxes(alert, prompt, confirm)

Box in JS :
1. Alert box:- Through the alert box we can print a message or a object value in a
Dialog box.
2. Confirm box:- Confirm box is used to take confirmation and return a Boolean
value
3. Prompt Box:- in prompt box we can print a message and also we can receive user
input.

datatype-
const, let, var;

Concatenation in JavaScript
("String value"+variable)
(name1+name2)

Typecasting in JS
convert one datatype to another

Quick Task
1. Add two numbers in JavaScript using user input;

Task -
1. What is JavaScript and use of JavaScript?
2. History of JavaScript.
3. What is Framework and 5 Frameworks of JS?
4. what is difference between ladder if-else and switch statement
5. difference between let, const, and var?

===================================================================================
======
___________________________________Self
Written__________________________________________

1. Keyword : Keywords are the reserved words, who has predefined meaning.

let = for declaring a variable-> re-assign but redeclare x(block scoped)


var = it can be re-assigned and redeclared
const = it can't re-assigned and can't redeclared(it is constant)
if, else =
for, while, do ->
switch
function
return
try, catch

2. Variables :- variable are the containers for storing data.


there four methods to declare variables

a = 10;
let b = 20;
var c = 30;
const d = 40;

3. DataTypes : -
JavaScript has 8 Types of DataType
1. String
2. Number
3. BigInt
4. Boolean
5. Undefined
6. null
7. Symbol
8. Object

4. Operator

5. Decision Controls
1. if :- if is a keywords which is used for decision making
2. if-else
3. ladder if-else
4. Switch Statement
5. Ternary Operator

6. Loop Controls
If you have a block of code and you want to execute that code again and again
up to a given condition is true then you can use loop controls.

1. While Loop:-
The while loop executes block repeatedly as long as the condition is true.
It is an entry-controlled loop (the condition is checked before executing the loop
body).
If the condition is false at the start, the loop never runs.

Syntax :-

Initialization;
while(condition)
{
//block of code to be executed
updation;
}

-------------------------

2. Do While Loop:-
The do-while loop is similar to the while loop.
The main difference is that it executes at least once, even if the condition is
false.
It is an exit-controlled loop (the body executes before checking the condition).

Syntax :-
Initialization;
do
{
//block of code to be executed
updation;

}while(condition);

-------------------------

3. For Loop
The for loop is used when the number of iterations is known.
and it is also similar to while loop but syntax is difference.

It has three parts:


1. Initialization → Runs once before the loop starts.
2. Condition → Checked before each iteration; the loop stops when it becomes
false.
3. Increment/Decrement → Updates the loop variable.

Syntax:-
for(initialization; condition, updation)
{
//block of code to be executed
}

--------------------------

4. Foreach Loop
The for-each loop is specifically used to iterate over arrays or collections (like
lists, sets, etc.).
It automatically fetches elements without needing an index.

You might also like