April 07 2026
FUNCTION
A function is a block of reusable code used to perform a specific task.
Why used function ?
The are used for specific task store one any the used for other code.
Syntax
function functionName {
// code
};
Example
Types of function
- Normal Function
- Function Expression
- Arrow Function
RETURN TYPES
The return keywords used to send a value back to funtion.
Syntax
function functionName {
// code
// return a+b;
};
Example
Types of Return Values
Number > return 1, 2...
String > return "vignesh"
Boolean > return true or false
Array > return [1,2,"vig",4]
Object > return {name:"Vignesh"}
CONSTRUCTOR
A constrution is special fuction used to create new objects. this is blueprint.
Example
Key points
new keyword is used different store.
this keyword is used refers to current object.
Used is multiple object created.
Array Method
array store multiple object in single variables.
let numbers = [10, 20, 30];
push() -> add element
push()
pop()
shift()
unshift()
forEach()
map()
filter()
reduce()
find()
findIndex()
(to be discuss )






Top comments (0)