🎉 Day 46 — React Mastery Completed (Final Summary & Congratulations!) Congratulations, developer! 👏 You’ve successfully completed the 45-Day React.js Roadmap — from understanding the fundamentals to mastering advanced concepts like Redux, Routing, Testing, and Deployment. 📘 What You’ve Learned ✅ React basics — Components, JSX, Props, and State ✅ Hooks — useState, useEffect, useRef, useMemo, and Custom Hooks ✅ Context API and Redux Toolkit for global state management ✅ Routing with React Router & Protected Routes ✅ Data fetching using Fetch API, Axios, React Query ✅ Advanced Patterns — Compound Components, Render Props, HOCs ✅ Styling — CSS Modules, Styled Components, Theming ✅ Animations, Accessibility, Testing, and Performance Optimization ✅ Deployment on Vercel, Netlify, or GitHub Pages 🧩 Final Project Ideas Now that you’re done, build real-world apps to polish your skills: 📝 Task ...
Get link
Facebook
X
Pinterest
Email
Other Apps
Get link
Facebook
X
Pinterest
Email
Other Apps
Day 32 : Arrays & Array Methods
📘 Day 32 — Arrays & Array Methods (Comprehensive)
Arrays are ordered lists of values and are essential for working with collections of data in JavaScript. Today we’ll explore creation, indexing, iteration, and the most useful built-in array methods (mutating and non-mutating), plus performance tips and real-world examples.
1 — Creating Arrays
let empty = [];
let nums = [1, 2, 3];
let mixed = ['text', 5, true, {name:'A'}, [1,2]];
let fromArray = Array.from('hello'); // ['h','e','l','l','o']
2 — Access & Length
Arrays are zero-indexed. The length property gives item count.
console.log(nums[0]); // 1
console.log(nums[nums.length - 1]); // last item
3 — Mutating Methods (change original array)
push(...items) — add to end
pop() — remove last
shift() — remove first
unshift(...items) — add to start
splice(start, deleteCount, ...items) — insert/remove at arbitrary position
let arr = [1,2,3];
arr.push(4); // [1,2,3,4]
arr.splice(1,1,'a'); // [1,'a',3,4]
4 — Non-Mutating Methods (return new arrays)
map(fn) — transform each element
filter(fn) — keep elements that pass test
reduce((acc, cur) => ... , initial) — reduce to single value
Comments
Post a Comment