Week 3 Day 1: JavaScript functions and objects

This commit is contained in:
2026-01-09 15:46:32 +05:30
parent c55dea91a9
commit 6d6a8fd0ea
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
## 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 keyvalue 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