Day 33 of #100DaysOfCode
Today I learned React Fragments <> to group multiple elements without adding extra nodes to the DOM.
return (
<>
<h1>Title</h1>
<p>Paragraph</p>
</>
);
#ReactJS#WebDev#Coding
Day 31 of #100DaysOfCode
Today I learned how to pass functions as props in React โ๏ธ
This allows child components to notify the parent โ like when an item is selected.
๐ก Itโs how React handles child-to-parent communication!
#ReactJS#JavaScript#Coding
โ Day 30 of #100DaysOfCode
Today I learned about React State Batching โ๏ธ
React groups multiple state updates into a single re-render for better performance.
Example: multiple setState() calls inside one event โ only 1 render happens! โก
#ReactJS#JavaScript#WebDev
โ Day 29 of #100DaysOfCode
Today I learned about useState & Props in React โ๏ธ
๐ช useState โ lets components store and update data dynamically.
๐ฆ Props โ pass data from parent to child components.
Core building blocks of interactive UIs! โก
Day 28 of #100DaysOfCode
Today I learned how to handle click events in React โ๏ธ
๐ Use the onClick prop
๐ For small logic โ inline
๐ For larger logic โ use a handler function (e.g. handleClick)
Keeps JSX clean & readable โจ
#ReactJS#JavaScript#Coding
Day 27 of #100DaysOfCode
Learned Conditional Rendering in React โ๏ธ
Used && to show content only when needed ๐
{cityName.length === 0 && <p>No Item Found</p>}
&& โ returns last true
|| โ returns first true
#ReactJS#JavaScript#Coding
Day 26 of #100DaysOfCode
Today I learned how to render arrays in React using .map()
function ListGroup() {
const cities = ["Mumbai", "Delhi", "Pune"];
return (
<ul>
{https://t.co/6njwua3o4w((city) => (
<li key={city}>{city}</li>
))}
</ul>
);
}
Day 25 of #100DaysOfCode
Today I learned:
โ๏ธ How to create a React Component
function Message() {
let name = "Suraj";
return <h1>Hello {name}</h1>;
}
export default Message;
๐ฑ React Ecosystem โ React works by updating the Virtual DOM, making UI updates fast.
#ReactJS
Day 24 of #100DaysOfCode
Today I learned the difference between Synchronous vs Asynchronous code โก
๐น Synchronous โ runs line by line, each task waits for the previous one.
๐น Asynchronous โ tasks like setTimeout & API calls run in background, donโt block execution.
#Coding
Day 21 of #100DaysOfCode
Today I learned DOM element selection in JS โจ
๐ getElementById() โ by ID
๐ getElementsByClassName() โ by class
๐ getElementsByTagName() โ by tag
๐ querySelector() โ first match
๐ querySelectorAll() โ all matches
#JavaScript#DOM#100DaysOfCode
Day 20 of #100DaysOfCode
Today learn about,
Pure Function โ Same input = Same output, no external changes.
Side Effect โ A function that modifies something outside its scope.
โ Pure functions are predictable & easier to test.
โ ๏ธ Side effects can cause unexpected behavior.
Day 19 of #100DaysOfCode
Today I learned about Asynchronous Code in JavaScript โก
๐น JS is single-threaded, but we can handle async tasks using callbacks, promises, or async/await.
๐น Example with setTimeout + callback:
Day 18 of #100DaysOfCode Today I learned about the sort() method in JavaScript
- sort() arranges array elements as strings by default (lexicographically).
- For numbers, we must pass a compare function.
โ Day 17 of #100DaysOfCode
Today I learned about Arrays of Objects in JavaScript ๐
๐น Useful when storing multiple items with properties (like user data, products, etc.)
๐น Can be looped through with for, forEach, map, etc.
Day 16 of #100DaysOfCode
โ Today I learned about ES6 Modules ๐ฆ in JavaScript
๐น export โ lets us share variables, functions, or classes
๐น import โ lets us use them in another file
๐น Helps keep code organized & reusable
Day 15 of #100DaysOfCode
Today I explored the Math object in JavaScript ๐งฎ
๐น Learned how to generate random numbers using Math.random()
Example:
const random = Math.floor(Math.random() * 10 + 1);
console.log(random); // 1 to 10
๐งโ๐ป Day 14 of #100DaysOfCode
Today I learned about setTimeout in JavaScript โณ
๐น Executes a function once after a specified delay (in ms).
๐น Useful for scheduling tasks, animations, and async behavior.