== and === in JavaScript

The equality operator in javascript is used to compare if two values are equal. The comparison is made by == and === operators in javascript. The main difference between the == and === operator in javascript is that the == operator does the type conversion of the operands before comparison, whereas the === operator compares the values as well as the data types of the operands. The == and != operators in javascript …

What are express.json() and express.urlencoded()

What is Middleware? It is those methods/functions/operations that are called BETWEEN processing the Request and sending the Response in your application method. When talking about express.json() and express.urlencoded() think specifically about POST requests (i.e. the .post request object) and PUT Requests (i.e. the .put request object) You DO NOT NEED express.json() and express.urlencoded() for GET Requests or DELETE Requests. You NEED express.json() and express.urlencoded() for POST and …

Cookies and Session

Cookies A cookie is a small piece of data sent by a server to a browser and stored on the user’s computer while the user is browsing. Cookies are produced and shared between the browser and the server using the HTTP Header. It Allows server store and retrieves data from the client, It Stored in a …

SQL vs. NoSQL

In the world of databases, there are two main types of solutions: SQL and NoSQL (or relational databases and non-relational databases). Both of them differ in the way they were built, the kind of information they store, and the storage method they use. Relational databases are structured and have predefined schemas like phone books that …

Consistent Hashing

Background While designing a scalable system, the most important aspect is defining how the data will be partitioned and replicated across servers. Let’s first define these terms before moving on: Data partitioning: It is the process of distributing data across a set of servers. It improves the scalability and performance of the system. Data replication: It is …

map() and forEach() in Javascript

The main difference between map and forEach is that the map method returns a new array by applying the callback function on each element of an array, while the forEach method doesn’t return anything.