I am excited to announce that I am joining the 100daysofcode Challenge! Over the next 100 days, I will be sharing my learning journey and progress with all of you.
Stay tuned to see my updates below, starting from today.
LETโS GET STARTED! ![]()
I am excited to announce that I am joining the 100daysofcode Challenge! Over the next 100 days, I will be sharing my learning journey and progress with all of you.
Stay tuned to see my updates below, starting from today.
LETโS GET STARTED! ![]()
๐๐๐ฒ ๐ : ๐๐จ๐ซ๐ฆ๐๐ฅ ๐ ๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ ๐ฏ๐ฌ. ๐๐ซ๐ซ๐จ๐ฐ ๐ ๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ ๐ข๐ง ๐๐๐ฏ๐๐๐๐ซ๐ข๐ฉ๐ญ
The key difference between the two functions lies in their handling of the this keyword.
โ ๐๐จ๐ซ๐ฆ๐๐ฅ ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ have their own this context, which changes depending on how they are called (whether globally or locally). This can cause problems that you might not be aware of.
โ ๐๐ซ๐ซ๐จ๐ฐ ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ, on the other hand, inherit this from the surrounding scope normally, making them particularly useful for maintaining context while calling them. Besides, it offers cleaner and easier code to read.
๐๐๐ฒ๐: ๐ฌ๐ฒ๐ง๐๐ก๐ซ๐จ๐ง๐จ๐ฎ๐ฌ ๐ฏ๐ฌ. ๐๐ฌ๐ฒ๐ง๐๐ก๐ซ๐จ๐ง๐จ๐ฎ๐ฌ ๐๐จ๐๐๐ฌ
The key difference lies in their ๐๐ฑ๐๐๐ฎ๐ญ๐ข๐จ๐ง and ๐๐๐ก๐๐ฏ๐ข๐จ๐ซ.
๐๐ฒ๐ง๐๐ก๐ซ๐จ๐ง๐จ๐ฎ๐ฌ โ executes tasks sequentially, blocking further tasks until completion. Used for simpler, linear code execution.
๐๐ฌ๐ฒ๐ง๐๐ก๐ซ๐จ๐ง๐จ๐ฎ๐ฌ โ executes tasks concurrently, allowing other tasks to proceed without waiting. Used for improving efficiency and handling multiple operations.
๐๐๐ฒ๐: ๐๐๐ฌ๐ญ๐ซ๐ฎ๐๐ญ๐ฎ๐ซ๐ข๐ง๐ ๐ฏ๐ฌ. ๐๐ฉ๐ซ๐๐๐๐ข๐ง๐
The key difference lies in their ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐ and there ๐ฎ๐ฌ๐๐ ๐.
๐๐๐ฌ๐ญ๐ซ๐ฎ๐๐ญ๐ฎ๐ซ๐ข๐ง๐ โ its purpose is to unpack values from arrays or objects into variables, and its main usage is for manipulating accesing values.
๐๐ฉ๐ซ๐๐๐๐ข๐ง๐ โ its purpose is to expand arrays and objects, and its main usage is to facilitate using or accessing array/object elements in functions.
๐๐๐ฒ๐: ๐ ๐จ๐ซ๐ฆ๐๐๐ญ๐ ๐ฏ๐ฌ. ๐ ๐จ๐ซ๐ฆ๐๐๐ฃ๐๐๐ญ
๐ ๐จ๐ซ๐ฆ๐๐๐ญ๐ and ๐ ๐จ๐ซ๐ฆ๐๐๐ฃ๐๐๐ญ can be confusing, so lets talk a little bit about:
They are compared in terms of their use cases and functionality, but they are ๐๐ฎ๐ง๐๐๐ฆ๐๐ง๐ญ๐๐ฅ๐ฅ๐ฒ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ:
โ ๐
๐จ๐ซ๐ฆ๐๐๐ญ๐ is a built-in JavaScript object specifically designed for form submissions, especially those involving file uploads, using multipart/form-data encoding.
โ ๐
๐จ๐ซ๐ฆ๐๐๐ฃ๐๐๐ญ is a custom pattern, not a built-in object, typically used to hold and manipulate form data in a simpler way, often serialized to JSON for API interactions.
So, while they serve different purposes, they can be compared based on their usage in handling form data.
๐๐๐ฒ๐: ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง ๐ฏ๐ฌ ๐๐๐ญ๐๐ฌ๐๐ญ.๐ฅ๐จ๐ง๐ ๐ข๐ญ๐ฎ๐๐/๐๐๐ญ๐๐ฌ๐๐ญ.๐ฅ๐๐ญ๐ข๐ญ๐ฎ๐๐
navigator.geolocation and dataset.longitude/dataset.latitude ๐ฌ๐๐ซ๐ฏ๐ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐๐ฌ in JavaScript.
โ ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง is used to get the deviceโs current geographical location.
โ ๐๐๐ญ๐๐ฌ๐๐ญ.๐ฅ๐จ๐ง๐ ๐ข๐ญ๐ฎ๐๐/๐๐๐ญ๐๐ฌ๐๐ญ.๐ฅ๐๐ญ๐ข๐ญ๐ฎ๐๐ are used to store and access custom geographical data attributes on HTML elements.
Although they serve different purposes, they can be used together for various applications, such as comparing a userโs current location to a predefined location stored in an HTML elementโs data attributes.
๐๐๐ฒ๐: ๐ฉ๐ซ๐จ๐ฆ๐ฉ๐ญ ๐ฏ๐ฌ. ๐๐ฅ๐๐ซ๐ญ ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ
๐ฉ๐ซ๐จ๐ฆ๐ฉ๐ญ and ๐๐ฅ๐๐ซ๐ญ are built-in functions used to interact with the user, but they serve different purposes:
โ alert purpose is displaying a message to the user, and shows a dialog with a specified message and an OK button. The user cannot interact with the rest of the page until the OK button is clicked, as well as itโs useful for showing information or warnings to the user.
โ prompt purpose is to ask the user to input a value. It shows a dialog with a specified message, a text input field, and OK and Cancel buttons. The function returns the input value if the user clicks OK or null if the user clicks Cancel. Also, it is useful for collecting simple user input.
๐๐๐ฒ ๐: ๐๐ฅ๐๐ฌ๐ฌ๐๐ข๐ฌ๐ญ ๐ฏ๐ฌ. ๐๐๐๐๐ฅ๐๐ฌ๐ฌ ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง๐ฌ
classList and addClass are methods used to, ๐ฆ๐๐ง๐ข๐ฉ๐ฎ๐ฅ๐๐ญ๐ ๐ญ๐ก๐ ๐๐ฅ๐๐ฌ๐ฌ๐๐ฌ ๐จ๐ ๐๐๐ ๐๐ฅ๐๐ฆ๐๐ง๐ญ๐ฌ, but they serve different purposes:
โ The purpose of classList is to provide a native and versatile way to ๐๐๐, ๐ซ๐๐ฆ๐จ๐ฏ๐, ๐ญ๐จ๐ ๐ ๐ฅ๐, and ๐๐ก๐๐๐ค classes on DOM elements.
โ The purpose of addClass is to ๐๐๐ ๐๐ฅ๐๐ฌ๐ฌ๐๐ฌ to elements using ๐ฃ๐๐ฎ๐๐ซ๐ฒ ๐ฅ๐ข๐๐ซ๐๐ซ๐ฒ. It requires jQuery and is less versatile, mainly used in projects already using jQuery.
๐๐๐ฒ ๐: ๐๐ซ๐ซ๐๐ฒ๐๐ฎ๐๐๐๐ซ/๐๐ฒ๐ฉ๐๐๐๐ซ๐ซ๐๐ฒ ๐ฏ๐ฌ. ๐๐จ๐ซ๐ฆ๐๐ฅ ๐๐๐ฏ๐๐๐๐ซ๐ข๐ฉ๐ญ ๐๐ซ๐ซ๐๐ฒ๐ฌ
ArrayBuffer/TypedArray and normal JavaScript arrays are used to ๐ฌ๐ญ๐จ๐ซ๐ ๐๐ง๐ ๐ฆ๐๐ง๐ข๐ฉ๐ฎ๐ฅ๐๐ญ๐ ๐๐๐ญ๐, but they serve different purposes:
โ The purpose of normal JavaScript arrays is to provide a flexible, dynamic data structure that can ๐ก๐จ๐ฅ๐ ๐ฆ๐ข๐ฑ๐๐ ๐ญ๐ฒ๐ฉ๐๐ฌ and ๐ ๐ซ๐จ๐ฐ ๐จ๐ซ ๐ฌ๐ก๐ซ๐ข๐ง๐ค as needed.
โ The purpose of ArrayBuffer/TypedArray is to provide a more ๐ฆ๐๐ฆ๐จ๐ซ๐ฒ-๐๐๐๐ข๐๐ข๐๐ง๐ญ, ๐๐ข๐ฑ๐๐-๐ฌ๐ข๐ณ๐, and ๐ฎ๐ง๐ข๐๐จ๐ซ๐ฆ ๐ญ๐ฒ๐ฉ๐ data structure, ideal for performance-critical and low-level binary data manipulation.
๐๐๐ฒ ๐: ๐๐ฅ๐จ๐ ๐ฏ๐ฌ. ๐ ๐ข๐ฅ๐
Blob and File are used to handle binary data in JavaScript, but they serve different purposes:
โ The purpose of Blob is to represent raw binary data that can be ๐ซ๐๐๐ ๐๐ฌ ๐ญ๐๐ฑ๐ญ, ๐๐ซ๐ซ๐๐ฒ ๐๐ฎ๐๐๐๐ซ, ๐จ๐ซ ๐๐๐ญ๐ ๐๐๐. It is versatile for creating and manipulating binary data in memory, uploading/downloading data, and generating object URLs for displaying or downloading content.
โ The purpose of File is to handle files directly, providing ๐๐๐๐ข๐ญ๐ข๐จ๐ง๐๐ฅ ๐ฆ๐๐ญ๐๐๐๐ญ๐ such as name and last modified date. It integrates seamlessly with file input elements and drag-and-drop functionality, making it ideal for handling files selected by users or programmatically created files with specific metadata.
๐๐๐ฒ ๐๐: ๐๐๐๐๐ญ๐ญ๐ฉ๐๐๐ช๐ฎ๐๐ฌ๐ญ ๐ฏ๐ฌ. ๐ ๐๐ญ๐๐ก ๐๐๐
๐๐๐๐๐ญ๐ญ๐ฉ๐๐๐ช๐ฎ๐๐ฌ๐ญ and ๐ ๐๐ญ๐๐ก ๐๐๐ are used to make HTTP requests in JavaScript, but they ๐ฌ๐๐ซ๐ฏ๐ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐๐ฌ and have distinct characteristics.
โ ๐๐๐๐๐ญ๐ญ๐ฉ๐๐๐ช๐ฎ๐๐ฌ๐ญ provides a way to make HTTP requests and handle responses using a more complex, callback-based syntax. It supports both synchronous and asynchronous requests, and offers progress events to monitor data transfer.
โ ๐ ๐๐ญ๐๐ก ๐๐๐ offers a modern, promise-based approach to making HTTP requests, with a simpler and more readable syntax. It only supports asynchronous requests and lacks built-in progress event handling but allows for better error handling and response parsing.
Although they serve different purposes, they can be used together or separately based on the requirements of your project, with Fetch API being the preferred choice for modern web development.
๐๐๐ฒ ๐๐: ๐ฆ๐๐ฉ ๐ ๐ฎ๐ง๐๐ญ๐ข๐จ๐ง ๐ฏ๐ฌ. ๐๐ซ๐ซ๐๐ฒ.๐๐ซ๐จ๐ฆ ๐ข๐ง ๐๐๐ฏ๐๐๐๐ซ๐ข๐ฉ๐ญ
map Function and Array.from are used to create new arrays in JavaScript, but they ๐ฌ๐๐ซ๐ฏ๐ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐๐ฌ and have distinct characteristics.
โ ๐ฆ๐๐ฉ ๐ ๐ฎ๐ง๐๐ญ๐ข๐จ๐ง: Transforms each element of an array according to a provided function, returning a new array of the same length. It is applied directly on an existing array.
โ ๐๐ซ๐ซ๐๐ฒ.๐๐ซ๐จ๐ฆ: Creates a new array instance from an array-like or iterable object, with an optional mapping function to transform elements during the creation of the new array.
๐๐๐ฒ๐๐: ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง.๐ฐ๐๐ญ๐๐ก๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง + ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง.๐๐ฅ๐๐๐ซ๐๐๐ญ๐๐ก
navigator.geolocation.๐ฐ๐๐ญ๐๐ก๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง and navigator.geolocation.๐๐ฅ๐๐๐ซ๐๐๐ญ๐๐ก can be used together to control real-time location tracking in javaScript.
โ ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง.๐ฐ๐๐ญ๐๐ก๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง is used to continuously monitor the deviceโs geographical location and provide real-time updates whenever the location changes. This method returns a watchId that you can use to stop tracking later.
โ ๐ง๐๐ฏ๐ข๐ ๐๐ญ๐จ๐ซ.๐ ๐๐จ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง.๐๐ฅ๐๐๐ซ๐๐๐ญ๐๐ก is used to stop the continuous monitoring that was initiated by watchPosition. You need to pass the watchId obtained from watchPosition to this method to stop receiving location updates.
๐๐๐ฒ๐๐: ๐๐ฌ๐ฒ๐ง๐/๐๐ฐ๐๐ข๐ญ ๐ฏ๐ฌ ๐๐จ๐ซ๐ฆ๐๐ฅ ๐๐ซ๐จ๐ฆ๐ข๐ฌ๐๐ฌ
๐๐ฌ๐ฒ๐ง๐/๐๐ฐ๐๐ข๐ญ simplifies asynchronous code.
โ ๐๐ฌ๐ข๐ง๐ ๐๐ฌ๐ฒ๐ง๐ ๐๐ง๐ ๐๐ฐ๐๐ข๐ญ:
โ ๐๐จ๐ซ๐ฆ๐๐ฅ ๐๐ซ๐จ๐ฆ๐ข๐ฌ๐๐ฌ:
๐๐๐ฒ๐๐: ๐๐๐ ๐ฏ๐ฌ ๐๐จ๐๐๐
SQL and NoSQL databases ๐ก๐๐ฏ๐ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐ฉ๐ฎ๐ซ๐ฉ๐จ๐ฌ๐๐ฌ ๐๐ง๐ ๐ฎ๐ฌ๐ ๐๐๐ฌ๐๐ฌ.
โ ๐๐๐ (Structured Query Language) databases are used for structured data with a fixed schema. They are ideal for applications requiring ACID (Atomicity, Consistency, Isolation, Durability) properties and complex queries. Examples include relational databases like MySQL and PostgreSQL.
โ ๐๐จ๐๐๐ (Not Only SQL) databases are designed for unstructured or semi-structured data with flexible schemas. They excel in scalability and performance for big data and real-time applications. Examples include MongoDB, Redis, and Cassandra.
While SQL databases are best for structured data and complex transactions, NoSQL databases offer flexibility and scalability for diverse data types and large-scale applications.
๐๐๐ฒ๐๐: ๐๐ฒ๐ฉ๐๐๐๐ซ๐ข๐ฉ๐ญ ๐ข๐ฆ๐ฉ๐ซ๐จ๐ฏ๐๐ฌ ๐๐๐ฏ๐๐๐๐ซ๐ข๐ฉ๐ญ
TypeScript and JavaScript ๐ก๐๐ฏ๐ ๐๐ข๐๐๐๐ซ๐๐ง๐ญ ๐๐๐๐ญ๐ฎ๐ซ๐๐ฌ ๐๐ง๐ ๐ฎ๐ฌ๐ ๐๐๐ฌ๐๐ฌ.
โ ๐๐ญ๐๐ญ๐ข๐ ๐๐ฒ๐ฉ๐ข๐ง๐ : TypeScript adds static typing to JavaScript, allowing for the detection of errors at compile time, leading to more reliable and maintainable code.
โ ๐๐จ๐๐ ๐๐ซ๐ ๐๐ง๐ข๐ณ๐๐ญ๐ข๐จ๐ง: TypeScriptโs module system and support for modern features like classes and interfaces help organize and structure code effectively, especially for large projects.
โ ๐๐จ๐ฆ๐ฉ๐ข๐ฅ๐-๐ญ๐ข๐ฆ๐ ๐๐ซ๐ซ๐จ๐ซ๐ฌ: Catching errors during compilation reduces bugs in production and makes code more predictable.
Although TypeScript introduces a learning curve and requires compilation, its improvements in code quality and maintainability make it a valuable enhancement to JavaScript.
๐๐๐ฒ๐๐: ๐๐๐ฌ๐ญ๐๐ ๐ฏ๐ฌ ๐๐๐ฑ๐ญ.๐ฃ๐ฌ
NestJS and Next.js have different purposes and use cases.
โ ๐๐๐ฌ๐ญ๐๐ is a backend framework designed for building efficient, reliable, and scalable server-side applications. It uses TypeScript and supports MVC architecture, dependency injection, and modular structure. Itโs ideal for creating RESTful APIs, GraphQL APIs, microservices, and applications requiring real-time capabilities (e.g., chat apps using WebSockets).
โ ๐๐๐ฑ๐ญ.๐ฃ๐ฌ is a frontend framework built on top of React for building server-side rendered (SSR) and static web applications. It supports file-based routing, API routes, and is optimized for performance and SEO. Itโs perfect for modern web applications, e-commerce websites, blogs, and personal websites.
While NestJS is best for developing robust backend applications, Next.js excels in creating performant and SEO-friendly frontend applications. Together, they can be used to build comprehensive fullstack applications.
๐๐๐ฒ๐๐: ๐๐๐ฆ๐ข๐ฑ ๐ฏ๐ฌ ๐๐๐๐๐ญ
Remix and React have different purposes and use cases.
โ ๐๐๐ฆ๐ข๐ฑ is a full-stack framework designed for building web applications with a focus on server-side rendering (SSR) and static site generation (SSG). It optimizes data loading, provides a powerful and flexible routing system, and supports progressive enhancement. Remix is ideal for building fast, SEO-friendly applications with robust form handling and enhanced performance out of the box.
โ ๐๐๐๐๐ญ is a frontend library for building user interfaces. It allows developers to create reusable UI components and manage state efficiently. React is highly flexible and can be used in various setups, from single-page applications (SPAs) to mobile apps using React Native. However, it requires additional tools and configurations for SSR, routing, and form handling.
While Remix offers a more opinionated framework with built-in tools for server-rendered applications, React provides the flexibility to build UIs in diverse environments. Depending on your project requirements, Remix can simplify the development of modern web applications, while React provides the foundational UI building blocks.
๐๐๐ฒ๐๐: ๐๐จ๐ฌ๐ญ๐ ๐ซ๐๐ฌ๐ช๐ฅ ๐ฏ๐ฌ ๐๐ฒ๐๐๐
PostgreSQL and MySQL are both popular relational databases but cater to different needs and use cases.
โ ๐๐จ๐ฌ๐ญ๐ ๐ซ๐๐ฌ๐ช๐ฅ is known for its advanced features and extensibility. It supports a wide range of data types, including JSONB and arrays, and offers full ACID compliance for robust transaction management. PostgreSQL is highly extensible, allowing for custom functions and data types. It excels in handling complex queries and large datasets, making it ideal for applications that require advanced features and strong consistency. Its support for full-text search and spatial data is a significant advantage for complex applications and data warehousing.
โ ๐๐ฒ๐๐๐ is renowned for its speed and reliability, particularly in read-heavy scenarios. It is widely used in web applications and integrates seamlessly with various technologies. MySQL offers solid performance and scalability, with various replication options and clustering solutions. While it supports JSON data, it lacks some of the advanced data types and extensibility features found in PostgreSQL. MySQL is simpler to set up for many standard use cases but may require additional configuration for advanced functionalities.
In summary, PostgreSQL provides a feature-rich, highly extensible solution suitable for complex applications and data-intensive tasks, while MySQL offers a fast, reliable database for web applications and high-read scenarios. Depending on your project needs, PostgreSQL may be preferable for advanced features and consistency, whereas MySQL might be the choice for ease of use and speed.
๐๐๐ฒ ๐๐: ๐๐ซ๐จ๐ฉ๐ฌ ๐ฏ๐ฌ. ๐๐ญ๐๐ญ๐ ๐ข๐ง ๐๐๐๐๐ญ
Props and state are fundamental concepts in React with different roles and characteristics.
โ ๐๐ซ๐จ๐ฉ๐ฌ: Props are used to pass data and functions from a parent component to a child component. They are immutable within the child component, meaning that the child cannot modify the props it receives. Props enable a unidirectional data flow, ensuring that data is passed from parent to child, making components more reusable and configurable.
โ ๐๐๐๐๐ญ: State is used to manage and track data within a component that can change over time. Unlike props, state is mutable and can be updated by the component itself using setState or useState. This allows components to handle dynamic data, respond to user interactions, and manage internal state changes.
Although props and state have distinct roles, props for configuring child components and state for managing internal data, but understanding their differences is crucial for effectively managing data and component behavior in React applications.