31 lines
611 B
Markdown
31 lines
611 B
Markdown
## JavaScript Functions
|
||
Functions are reusable blocks of code used to perform a specific task.
|
||
|
||
### Types of functions:
|
||
- Function Declaration
|
||
- Function Expression
|
||
- Arrow Functions (ES6)
|
||
|
||
### Benefits:
|
||
- Code reusability
|
||
- Better structure
|
||
- Easier debugging
|
||
|
||
## JavaScript Objects
|
||
Objects store data in key–value pairs.
|
||
|
||
const user = {
|
||
name: "Harshit",
|
||
role: "Intern",
|
||
skills: ["HTML", "CSS", "JS"]
|
||
};
|
||
|
||
### Object concepts:
|
||
- Properties
|
||
- Methods
|
||
- Access using dot and bracket notation
|
||
|
||
### Practical Learning
|
||
- Created reusable functions
|
||
- Accessed object properties
|
||
- Used functions inside objects |