Sign in

Learning Consistently — How To Learn, How To Read, Data Structures and Algorithms. Coding Consistently — JavaScript
Different Containers to Hold Different Things — Cupboard for clothes, Cabinet for Files, Book Case, Suitcase for packing items while travelling, and Fridge for Clothes.

In real life, we have containers for food (refrigerator), files (folders/file cabinets), toys (packing boxes), or clothes (cupboard). Each container is specific for a thing. We will not put files in packing boxes as they will crumble. It is a way for us to organize our things so we can go back and retrieve them easily.

Similarly, we put data in data structures and retrieve them from the data structures — that is all it is.

Just like in real life, there are tons of data structures in programming as well.

Introduction to Data Structure

A data structure is a collection of values, these…


Function Overloading in JavaScript (Made with Excalidraw)

Function Overloading In Programming Languages

Function overloading means creating multiple functions with different implementations. The rules in function overloading are

  1. The same function name is used for more than one function definition.
  2. The functions must differ by the types of their parameters.

Function Overloading in JavaScript

JavaScript does not support function overloading.

/**
* Display Name
* @param {string} name Name
*/
function displayName(name) {
return `Hi ${name}`;
}
/**
* Display Name
* @param {string} fName First Name
* @param {string} lName Last Name
* The above function will be overwritten by this function.
*/
function displayName(fName, lName) {
return `Hi ${fName} ${lName}`;
}
displayName('Ana'); // 'Hi Ana…


Ralph Waldo Emerson

This blog gives steps for adding local fonts in your React project.

Pre-requisite

@font-face

It is used to specify a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user’s own computer.

Steps

  1. Create a fonts folder in the src folder of the React project.
  2. Add the local font files in the font folder. You can add all the font file formats.
  3. Define the custom fonts using @font-face in the main CSS file. This can be done as follows.

👉 Create a font.css file and put the properties…


Photo by freestocks on Unsplash

The year 2020 has come to an end though, to tell the truth, this year will have a long-lasting impact on us. We are yet to come out of it and get ready to face new challenges. This year my challenge was to keep reading.

In a fantastic video titled BOOKSTORES: How to Read More Books in the Golden Age of Content by Max Joseph I learnt three things

  • You cannot read all the books. It should not intimidate you but remind you how much you don’t know and should inspire you to be selective and read.
  • If you read…


Photo by Samantha Lam on Unsplash

In React keys are unique identifiers.

It helps to identify the items that have changed, or added, or removed. The best way to pick a key is to use a string that uniquely identifies a list item in the lists.

const toDos = todos.map((todo) => 
<div key={todo.id}>
{todo.description}
</div>
);

Why do we need keys?

Consider the todo list const todos = ['Make Pancake', 'Read a Book']; It will be rendered in DOM as

<ul>
<li>Make Pancake</li>
<li>Read a Book</li>
</ul>

If we add one item at the beginning of the list, the new list is const todos = [’Go to Market’, 'Make Pancake’, 'Read…


The Notion is amazing, to tell the truth, anything that helps us to ease the task of the organization is amazing.

One of the most important features provided by Notion is a toggle.

Toggle List — Notion

We know that for better studying we should practice spaced repetition. Toggle helps in effective spaced repetition.

How to use toggle?

Consider you are making notes on a topic let us say World War 1.

World War I, also known as the Great War, began in 1914 after the assassination of Archduke Franz Ferdinand of Austria. His murder catapulted into a war across Europe that lasted until 1918. During the conflict…


This blog summarises the weird relationship between string and mathematical operations in JavaScript. Let us start with a brief on strings in JavaScript. Then in the next section, we will see the relationship of strings with the most common mathematical operators.

Strings in JavaScript

Strings are used to represent and manipulate a set of characters. We can create strings in different ways.

// String Primitive
const string1 = “The quick brown ”;
const string2 = ‘fox jumps over ’;
const string3 = `the lazy dog`;
// String Object
const string4 = new String(‘Some string’);
// Other Examples const string5 = ‘1234567890’; const string6…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store