JavaScript Basics
• Beginner Level Training
• Duration: 1 Day
• Topics:
• - Introduction
• - Syntax
• - Variables
• - Data Types
• - Operators
What is JavaScript?
• • JavaScript is a scripting language used to
create and control dynamic website content.
• • It runs in the browser.
• • It can update and change both HTML and
CSS.
• • It can calculate, manipulate and validate
data.
JavaScript Syntax
• • JavaScript syntax is the set of rules that
define a correctly structured JavaScript
program.
• Example:
• let x = 5;
• let y = 6;
• let z = x + y;
Variables
• • Used to store data values.
• • Declared using: var, let, const
• Example:
• let name = 'John';
• const PI = 3.14;
Data Types
• • String
• • Number
• • Boolean
• • Undefined
• • Null
• • Object
• • Array
• Example:
Operators
• • Arithmetic: +, -, *, /, %
• • Assignment: =, +=, -=, etc.
• • Comparison: ==, ===, !=, >, <
• • Logical: &&, ||, !
Conditional Statements
• • if, else if, else
• Example:
• if(age > 18){
• [Link]("Adult");
• } else {
• [Link]("Minor");
• }
Loops
• • for loop
• • while loop
• • do...while loop
• Example:
• for(let i=0; i<5; i++){
• [Link](i);
• }
Functions
• • A block of code designed to perform a task.
• Example:
• function greet(name){
• return "Hello " + name;
• }
Conclusion
• Practice regularly and explore DOM, Events,
and advanced topics next.
• Happy Coding!