<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[tech blogs]]></title><description><![CDATA[tech blogs]]></description><link>https://www.shubhujalablogs.live</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 22:56:44 GMT</lastBuildDate><atom:link href="https://www.shubhujalablogs.live/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[03 Control Flow in JavaScript: If, Else, and Switch Explained]]></title><description><![CDATA[hey readers]]></description><link>https://www.shubhujalablogs.live/control-flow</link><guid isPermaLink="true">https://www.shubhujalablogs.live/control-flow</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:04:22 GMT</pubDate><content:encoded><![CDATA[<p>hey readers</p>
]]></content:encoded></item><item><title><![CDATA[05 Arrow Functions in JavaScript: A Simpler Way to Write Functions
]]></title><description><![CDATA[Arrow functions]]></description><link>https://www.shubhujalablogs.live/arrow-functions</link><guid isPermaLink="true">https://www.shubhujalablogs.live/arrow-functions</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:03:27 GMT</pubDate><content:encoded><![CDATA[<p>Arrow functions</p>
]]></content:encoded></item><item><title><![CDATA[09 The Magic of this, call(), apply(), and bind() in JavaScript
]]></title><description><![CDATA[today we are gi]]></description><link>https://www.shubhujalablogs.live/this</link><guid isPermaLink="true">https://www.shubhujalablogs.live/this</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:02:48 GMT</pubDate><content:encoded><![CDATA[<p>today we are gi</p>
]]></content:encoded></item><item><title><![CDATA[10 Understanding Object-Oriented Programming in JavaScript
]]></title><description><![CDATA[hey! readers]]></description><link>https://www.shubhujalablogs.live/oops</link><guid isPermaLink="true">https://www.shubhujalablogs.live/oops</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:01:55 GMT</pubDate><content:encoded><![CDATA[<p>hey! readers</p>
]]></content:encoded></item><item><title><![CDATA[02 JavaScript Operators: The Basics You Need to Know
]]></title><description><![CDATA[hey readers! welcome back to another blog of js series, in this blog we are going to discuss about the operators in javaScript]]></description><link>https://www.shubhujalablogs.live/operators</link><guid isPermaLink="true">https://www.shubhujalablogs.live/operators</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 17:00:37 GMT</pubDate><content:encoded><![CDATA[<p>hey readers! welcome back to another blog of js series, in this blog we are going to discuss about the operators in javaScript</p>
]]></content:encoded></item><item><title><![CDATA[01 Understanding Variables and Data Types in JavaScript
]]></title><description><![CDATA[Hey readers, welcome to the first blog of the JS series , in this blog we are going to discuss about ht variables and datatypes in the JavaScript, and also going to see some examples of scoping.
So wi]]></description><link>https://www.shubhujalablogs.live/variables-dataypes</link><guid isPermaLink="true">https://www.shubhujalablogs.live/variables-dataypes</guid><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sun, 15 Mar 2026 12:09:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/f285e557-950d-459c-8887-05988b96cb37.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey readers, welcome to the first blog of the JS series , in this blog we are going to discuss about ht variables and datatypes in the JavaScript, and also going to see some examples of scoping.</p>
<p>So without thinking too much let's proceed with the topics.</p>
<h3>What is variables?</h3>
<p>think of it like a box , you must have seen you mom storing the matarials inside the box for example , she stores sugar inside a box and on the top of that box she labels it as a <code>sugar</code> similarly for the salt and other stuff also</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/e84cfc3b-9925-4a12-aa8a-e0a2065c0666.png" alt="" style="display:block;margin:0 auto" />

<p>think of it like this</p>
<ul>
<li><p>Label on the box (variable)</p>
</li>
<li><p>material inside it is the main content (datatypes)</p>
</li>
</ul>
<p>Why we are giving such label to the box? the simple answer to the question is to pick the required material easily.</p>
<hr />
<h3>Naming rules for variable</h3>
<p>here are the rules that you have to keep in mind while declaring the variables</p>
<ol>
<li><p>It can contain only characters, numbers, $, and _</p>
</li>
<li><p>You cannot use keywords as variable names, for example: class, number, new, this etc.</p>
</li>
<li><p>Variable names can not we start with the numbers</p>
<pre><code class="language-javascript">// valid variable names
let name = "shubh"
let $name = "shubh";
let _db = "mydb"
let $_items = "my items";

// invalid variable names
let 1name = "shubh" // incorrect : since starts with number
let this = "mythis" // incorrect : since using keyword `this`
</code></pre>
</li>
</ol>
<hr />
<h3>How to declare a variable?</h3>
<p>In javaScript , since it is loosely typed language , so we don't need to define any type before defining variables hence we can use <code>var</code> , <code>let</code> or <code>const</code> to declare the variable. let's understand the usecase and the difference between all these ways</p>
<p><strong>var</strong></p>
<ul>
<li><p>it is an oldest way to decalre a variable in javaScript (this is how its done)</p>
<pre><code class="language-javascript">
var name = "shubh"
</code></pre>
<p>and generally not recommended to use althrough it is working perfectly but still due some issues it is not recommended.</p>
</li>
<li><p>it is a function-scopped, means whenever we are using var inside the functions then only we are able to use it properly otherwise it will be accessed globally (this is the probelm which i was talking about in 1st point). let me clear it with one example as well :</p>
<pre><code class="language-javascript">
let b = 10;
{
    let a = 20;
}


console.log(a); // output : 20
</code></pre>
<p>on the above example , can you guess the output? you must be thinking it must through error since it is not in the correct scope but you are wrong it will give <code>20</code> as the output. this is the problem with <code>var</code> .</p>
</li>
<li><p>during hoisting we can access it even before declaration but the value returned by it will be <code>undefined</code></p>
</li>
<li><p>Also there is one more problem with <code>var</code> we can literally redeclare the variable using <code>var</code></p>
<pre><code class="language-javascript">
var a = 30;
var a = 20;
console.log(a); // 20
</code></pre>
</li>
</ul>
<p><strong>let</strong></p>
<ul>
<li><p>it is introduced in ES6 module of javaScript, to solve the problem that are occuring due to <code>var</code></p>
<pre><code class="language-javascript">let a = 20;

console.log(a);
</code></pre>
</li>
<li><p><code>let</code> is blocked scoped, so we can only access the value inside the same scope , unlike the <code>var</code></p>
</li>
<li><p>we can not redeclare the variable using <code>let</code> .</p>
</li>
<li><p>while hoisting, the variables which are defined using <code>let</code> are not bound to the global hence we can't access the variables before declaration</p>
<pre><code class="language-javascript">
console.log(a); // error : Cannot access 'a' before initialization

let a = 20; 
</code></pre>
</li>
</ul>
<p><strong>const</strong></p>
<ul>
<li><p>this is also introduced in ES6 modules, and also having almost all the features of <code>let</code> the only change is it is having some rules / strictness like</p>
<ul>
<li><p>we can't change it's value</p>
</li>
<li><p>we must have to assign value while declaring the variable, which was optional in case of <code>var</code> or <code>let</code></p>
<pre><code class="language-javascript">const key = `SecuredKey`;

//const myKey; this is not allowed
</code></pre>
</li>
</ul>
</li>
</ul>
<hr />
<h3>Comparision between <code>var</code> , <code>let</code> and <code>const</code></h3>
<table>
<thead>
<tr>
<th><strong>var</strong></th>
<th><strong>let</strong></th>
<th><strong>const</strong></th>
</tr>
</thead>
<tbody><tr>
<td>The scope of a <em><strong>var</strong></em> variable is functional or global scope.</td>
<td>The scope of a <em><strong>let</strong></em> variable is block scope.</td>
<td>The scope of a <em><strong>const</strong></em> variable is block scope.</td>
</tr>
<tr>
<td>It can be updated and re-declared in the same scope.</td>
<td>It can be updated but cannot be re-declared in the same scope.</td>
<td>It can neither be updated or re-declared in any scope.</td>
</tr>
<tr>
<td>It can be declared without initialization.</td>
<td>It can be declared without initialization.</td>
<td>It cannot be declared without initialization.</td>
</tr>
<tr>
<td>It can be accessed without initialization as its default value is "undefined".</td>
<td>It cannot be accessed without initialization otherwise it will give 'referenceError'.</td>
<td>It cannot be accessed without initialization, as it cannot be declared without initialization.</td>
</tr>
</tbody></table>
<hr />
<h3>Scopes</h3>
<p>Scope is the term which defines that where your variables can be accessed , basically it tells us about the boundary of the variable till where it can be accessed , in javaScript there are majorly 3 types of scopes:</p>
<p>Global scope : global scope means we are declaring the variable outside the block or function, then it is considered that you variable now having the global scope and can be accessed anywhere in the file</p>
<pre><code class="language-javascript">let a = 20;

{
    console.log(a); //20 , here variable a is global scopped
}
</code></pre>
<p>Block scope : Block scope mean we are declaring the variable inside the block <code>{ }</code> , and that variable can only be accessed inside that block only</p>
<pre><code class="language-javascript">{
    let z = "block scope"
    console.log(z); // valid // "block scope"
}
console.log(z); // not accessable
</code></pre>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Note : if we use the var inside the block scope then it will be accessable outside also</mark></p>
<p>Function scope : function scope means the variable only be accessible inside the function only.</p>
<pre><code class="language-javascript">function sayHi(){
    let name = "shubh";
    console.log(name); // valid // shubh
    
}
console.log(name); // error accessing the element
</code></pre>
<p>Summary :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/42859090-f869-4c0c-86bb-c2a375019ec6.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Datatypes in JavaScript</h3>
<p>In javaScript , datatypes are divided into two categories : <code>primitive</code> and <code>non-primitive</code>.</p>
<ol>
<li><p><strong>primitive</strong> : the datatypes which are already defined by the makers are known as primitive data types. there are total 7 primitive datatypes in js.</p>
</li>
<li><p><strong>Non-primitive :</strong> non- primitive means user-defined types</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/db5aa2ed-161e-459b-857f-548c0f4f3dda.png" alt="" style="display:block;margin:0 auto" />

<p>let quickly go through with each type:</p>
<p><strong>Primitive</strong></p>
<ol>
<li><p>Symbol - Unique and immutable identifier</p>
</li>
<li><p>Number - used to store the numeric values , it covers all type of numbers which includes integers, float, double , infinity, -infinity etc</p>
</li>
<li><p>BigInt - it is use very long numbers eg : <code>const bigInt = 1234483792n</code></p>
</li>
<li><p>String - it is used to store the text values , eg : <code>const str= "shubh"</code></p>
</li>
<li><p>Boolean - it is used to store the <code>true</code> or <code>false</code></p>
</li>
<li><p>null - it is special data type of javaScript, which means the variable is empty, developer intentionally assign the null to the variable that till now has no data but in future will see for now it is empty , eg: <code>let balance = null</code></p>
</li>
<li><p>undefined - when we don't assign anything to the variable then that variable's data type is know as <code>undefined</code> , eg : <code>let name</code></p>
</li>
</ol>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Note : if you want to check the type of variable in js the you can simply use the </mark> <code>typeof</code></p>
<p><strong>non - primitive</strong></p>
<ol>
<li><p>Array - A special type of object used to store multiple values in an ordered list using indexes.</p>
<pre><code class="language-javascript">let marks = [90,33, 99, 100];
</code></pre>
</li>
<li><p>Object - A collection of key–value pairs used to store related data and functions together.</p>
<pre><code class="language-javascript">const myDetails = {
     name : "Shubh",
     age : 22,
     city : "jalandhar",
     salary : '10Lpa'
 }
</code></pre>
</li>
<li><p>Functions - A reusable block of code designed to perform a specific task and can be stored in variables or passed as values.</p>
<pre><code class="language-javascript">function addNums(x,y,z){
    return x + y + z;
}
</code></pre>
</li>
</ol>
<hr />
<p>Hope you love the blog ❤️</p>
]]></content:encoded></item><item><title><![CDATA[06 Understanding Objects in JavaScript]]></title><description><![CDATA[Hey readers! Welcome to another blog of JavaScript series, in this blog we are going to discuss about the objects in JavaScript, why are they even required? what is the syntax to write it and looping ]]></description><link>https://www.shubhujalablogs.live/object</link><guid isPermaLink="true">https://www.shubhujalablogs.live/object</guid><category><![CDATA[Objects]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[js]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sat, 14 Mar 2026 20:24:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/e452aedb-c731-45f0-9413-dc5e8f84ea5a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey readers! Welcome to another blog of JavaScript series, in this blog we are going to discuss about the objects in JavaScript, why are they even required? what is the syntax to write it and looping on the objects as well.</p>
<p>As of now we know about the <a href="https://www.shubhujalablogs.live/javascript-arrays">arrays</a> in javaScript, so the question that comes in our mind is if array is already there then what is the requirement of the objects? well we can understand it with a example:</p>
<p>Suppose I want to store my name , age and city then using array this is i can store my details</p>
<pre><code class="language-javascript">
const myDetails = ["shubh", 22, "jalandhar"];
</code></pre>
<p>Now lets try to store the same data in the object</p>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}
</code></pre>
<p>When one you found more meaningful? obvoiusly the object one right? so this is why we need objects to store the data with meaning</p>
<p>So, Object is nothing just a collection of key-value pairs , where key is the label (like <code>name</code>, <code>age</code>, <code>city</code> ) and the value is actual data which we are storing <code>"shubh" 22</code>,<code>"jalandhar"</code>)</p>
<h3>Creating objects</h3>
<p>we can create object using curly braces <code>{ }</code></p>
<pre><code class="language-javascript">
const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}
console.log(myDetails)
</code></pre>
<hr />
<h3>Accessing properties</h3>
<p>In the object we can access the properties using two notations</p>
<ol>
<li><strong>Dot Notation</strong></li>
</ol>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}

console.log(myDetails.age);
console.log(myDetails.city);
console.log(myDetails.name);
</code></pre>
<ol>
<li><strong>Bracket Notation</strong></li>
</ol>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}

console.log(myDetails['name']);
console.log(myDetails['age']);
</code></pre>
<hr />
<h3>Updating object properties</h3>
<p>we can update the properties of the object like this</p>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}

myDetails.age = 21,
console.log(myDetails);
</code></pre>
<hr />
<h3>Adding and Deleting properties</h3>
<ol>
<li><p><strong>Adding property</strong></p>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar"
}

myDetails.salary = '10Lpa',
console.log(myDetails);
</code></pre>
</li>
<li><p>Deleting property</p>
<pre><code class="language-javascript">const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar",
    salary : '10Lpa'
}

delete myDetails.salary
console.log(myDetails);
</code></pre>
</li>
</ol>
<hr />
<h3>Looping through object</h3>
<p>to simply loop over the object we can use the <code>for...in</code> loop, like this:</p>
<pre><code class="language-javascript">
const myDetails = {
    name : "Shubh",
    age : 22,
    city : "jalandhar",
    salary : '10Lpa'
}

for (const key in myDetails) {
    console.log(myDetails[key]);
}

// output :
/*
    Shubh
    22
    jalandhar
    10Lpa

*/
</code></pre>
<hr />
<h3>Array vs Objects</h3>
<table>
<thead>
<tr>
<th><strong>Feature</strong></th>
<th><strong>JavaScript Arrays</strong></th>
<th><strong>JavaScript Objects</strong></th>
</tr>
</thead>
<tbody><tr>
<td><strong>Index Type</strong></td>
<td>Numeric indexes (0, 1, 2, ...)</td>
<td>Named keys (strings or symbols)</td>
</tr>
<tr>
<td><strong>Order</strong></td>
<td>Ordered collection</td>
<td>Unordered collection</td>
</tr>
<tr>
<td><strong>Use Case</strong></td>
<td>Storing lists, sequences, ordered data</td>
<td>Storing data with key-value pairs, attributes</td>
</tr>
<tr>
<td><strong>Accessing Elements</strong></td>
<td>Accessed by index (e.g., arr[0])</td>
<td>Accessed by key (e.g., obj["key"])</td>
</tr>
<tr>
<td><strong>Iteration</strong></td>
<td>Typically iterated using loops like for or forEach</td>
<td>Iterated using for...in, Object.keys(), or Object.entries()</td>
</tr>
</tbody></table>
<hr />
<h3>Try it yourself</h3>
<p>Here are the questions that you can practice by your own</p>
<ol>
<li><p>Create an object representing a student</p>
</li>
<li><p>Add properties like name, age, course</p>
</li>
<li><p>Update one property</p>
</li>
<li><p>Print all keys and values using a loop</p>
</li>
</ol>
<hr />
<h3>Conclusion</h3>
<p>Objects are used when we want give details with label</p>
<ul>
<li><p>Object : key-value pair</p>
</li>
<li><p>values of the object are accesed using dot notation, brackets notation</p>
</li>
<li><p>we can add, remove or update the values of the object</p>
</li>
<li><p>for looping we have to use <code>for...in</code> through keys</p>
</li>
</ul>
<hr />
<p>Hope you enjoyed reading❤️</p>
]]></content:encoded></item><item><title><![CDATA[04 Function Declaration vs Function Expression
]]></title><description><![CDATA[Hey! readers in this blog we are going to go throught with the functions in javaScript, basic syntax , declaration , expression etc.
First question that comes in our mind is - what exactly is function]]></description><link>https://www.shubhujalablogs.live/functions</link><guid isPermaLink="true">https://www.shubhujalablogs.live/functions</guid><category><![CDATA[functions]]></category><category><![CDATA[js]]></category><category><![CDATA[basics]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sat, 14 Mar 2026 19:46:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/ad42923f-d59c-4795-8d48-5d56c0cdf781.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey! readers in this blog we are going to go throught with the functions in javaScript, basic syntax , declaration , expression etc.</p>
<p>First question that comes in our mind is - what exactly is function?</p>
<ul>
<li>In simpler terms it is something which to maintain dry (don't repeat yourself) principal , means it is that block of code which we have to use again and again in our codebase</li>
</ul>
<p>still not clear? just look at this example:</p>
<p>Suppose we want to add two numbers a &amp; b then how we are going to write the code it will be something like this :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/12f23f4b-3ff7-4728-968a-b53b1a09c500.png" alt="" style="display:block;margin:0 auto" />

<p>but what if i told you again i have to add two numbers whose value is 70 and 80 , and i want to add these two numbers then it will be like this :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/d2512819-8703-48af-a339-638192cf1619.png" alt="" style="display:block;margin:0 auto" />

<p>Have you observed something? ain't we repeating the same block of code again to get the desired output? Yes, we are now what will happens if i told to to again add two numbers whose value is 90 and 100 , then again you have to create 2 variables and again strore the result into another variable and then print the required output. So yes, we are repeating same code again and again , hence to overcome this problem concept of <code>functions</code> came into the existance.</p>
<p>Same problem using functions :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/d6dc4eeb-6d5e-4f02-945f-52be35b4ad95.png" alt="" style="display:block;margin:0 auto" />

<p>Now look at the above example, how <code>function</code> made our task very easy we just have to call that function and pass the arguments in it and done, we got out ans. So this is why we required <code>functions</code>.</p>
<hr />
<h3>Function Declaration</h3>
<ul>
<li>it has a function name right there , we simply have to call that bame</li>
</ul>
<pre><code class="language-javascript">function add(x, y){
    return x + y;
}

let ans1 = add(4,5);
console.log(ans1); // output : 9
</code></pre>
<h3>Function Expression</h3>
<ul>
<li><p>it basically means we are creating a function but storing that function in a seprate variable</p>
<pre><code class="language-javascript">const add = function(x,y){
    return x + y;
}

let ans = add(10,20);
console.log(ans); // output 30

// here add becomes the function's name which is used for calling
// that function
</code></pre>
</li>
</ul>
<hr />
<h3>Difference between the Declaration and Expression</h3>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Function Declaration</th>
<th>Function Expression</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Definition</strong></td>
<td>A function defined with the <code>function</code> keyword and a name.</td>
<td>A function stored inside a variable.</td>
</tr>
<tr>
<td><strong>Syntax</strong></td>
<td><code>function add(a, b) { return a + b; }</code></td>
<td><code>const add = function(a, b) { return a + b; };</code></td>
</tr>
<tr>
<td><strong>Hoisting</strong></td>
<td>Fully hoisted — can be called <strong>before it is defined</strong>.</td>
<td>Not hoisted in the same way — <strong>cannot be called before definition</strong>.</td>
</tr>
<tr>
<td><strong>Name Requirement</strong></td>
<td>Must have a <strong>function name</strong>.</td>
<td>Can be <strong>anonymous</strong> (no name).</td>
</tr>
</tbody></table>
<hr />
<h3>Basic Idea of hoisting :</h3>
<p>Hoisting refers to the behavior where JavaScript moves the declarations of the variables and functions to the top of their scope during the compilation phase.</p>
<p>Key point -</p>
<ul>
<li><p><strong>Function declaration</strong> can generally be used before they apper in the code</p>
<pre><code class="language-javascript">const ans = addNums(2,3,4);
console.log(ans); // output : 9

function addNums(x,y,z){
    return x + y + z;
}
</code></pre>
</li>
<li><p><strong>Function expression</strong> usually can't be used before they are defined</p>
<pre><code class="language-javascript">const ans = addNums(2,3,4);
console.log(ans); // error

const addNums = function (x,y,z){
    return x + y + z;
}
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/87828eab-1192-4916-9f4e-20dca5fdc1af.png" alt="" style="display:block;margin:0 auto" /></li>
</ul>
<h3>When to use each type ?</h3>
<ol>
<li><p><strong>Function declaration</strong> : when we want a simple named function, or when we want to call it anywhere, even above the definition of the function or when we are writing normal "utility" functions like <code>add</code> <code>subtract</code> <code>multiply</code> etc.</p>
<pre><code class="language-javascript">function addNums(x,y,z){
    return x + y + z;
}
</code></pre>
</li>
<li><p><strong>Function Expression :</strong> when we want to store the function in a variable or when we want to pass it somewhere.</p>
<pre><code class="language-javascript">const  addNums = function(x,y,z){
    return x + y + z;
}
</code></pre>
</li>
</ol>
<hr />
<h3>Try it yourself :</h3>
<p>here are some simple tasks that you can perform :</p>
<ol>
<li><p>Write a function declaration that multiplies two numbers</p>
</li>
<li><p>Write the same logic using function expression</p>
</li>
<li><p>Call both functions and print results</p>
</li>
<li><p>Try calling them before defining and observe behavior</p>
</li>
</ol>
<hr />
<h3>Conclusion</h3>
<p>Functions are the building blocks of reusable, maintainable JavaScript. They let you follow the DRY principle by encapsulating logic you need to run multiple times.</p>
<ul>
<li><p>just keep one thing in mind (hoisting)</p>
<ul>
<li><p>Declaration : works before the definition</p>
</li>
<li><p>Expression : throws an error.</p>
</li>
</ul>
</li>
</ul>
<hr />
<p>Hope you enjoyed reading❤️</p>
]]></content:encoded></item><item><title><![CDATA[07 JavaScript Arrays ]]></title><description><![CDATA[Hey! readers in this blog we are going to understand about the Arrays , very important data structure , we will undertand what is the need of it?, where it used ? and how we can implement this in java]]></description><link>https://www.shubhujalablogs.live/javascript-arrays</link><guid isPermaLink="true">https://www.shubhujalablogs.live/javascript-arrays</guid><category><![CDATA[js]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[arrays]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sat, 14 Mar 2026 13:41:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/4f31a1b7-fbc7-4b9a-bb8d-d2de6326aa93.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey! readers in this blog we are going to understand about the <code>Arrays</code> , very important data structure , we will undertand what is the need of it?, where it used ? and how we can implement this in javaScript.</p>
<p>So let's proceed with the example:</p>
<p>Suppose there is no concept of arrays, and you are given with the task to store 7 names then how you are going to do this task? obviously using the variables you will be doing something like this</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/765b3c6f-257c-4d14-8ef9-2cfa8d0a5b2c.png" alt="" style="display:block;margin:0 auto" />

<p>since it is 7 names so it seems do-able right? but what if i told you to store 1000 names or 10,000 names then how it sounds? still do-able but time consuming and also sounds difficult to create 1000 variables and manage them, So to solve these kind of problems <code>arrays</code> were introduced and with the help of <code>arrays</code> this is how we can perfom our tasks</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/b2d708e7-567a-47a5-abed-4887a2be65b6.png" alt="" style="display:block;margin:0 auto" />

<p>So this is how with the help of arrays we can store all the names in the single variable only and we can access the values using the indexes (0,1,2..)</p>
<hr />
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Note </mark> : In Javascript it is not necessary to have the element inside the array of same datatypes , we can store the elements having different datatypes as well for example</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/95bf5976-7b3a-4fe9-9d60-ce982cdef05c.png" alt="" style="display:block;margin:0 auto" />

<p>here you can see , we have storted the string, number, boolean inside the same array (and this is only possible in JS language.)</p>
<hr />
<p>So we have already seen the array representation and the need of array, now we can say that it is a { collection of values stored in order }</p>
<p>Now let's take one example and perform some operations on the array</p>
<pre><code class="language-javascript">
const arr = ["shubh",1,2,"work",true,{taks:"gym"}];

console.log(typeof arr) // output : object
</code></pre>
<p>Output : object (since everthing in javaScript is an object.)</p>
<hr />
<p>Now let see how can we access the values</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/ad30a6d6-f9c2-412a-bf34-64eaef825c79.png" alt="" style="display:block;margin:0 auto" />

<p>As you can see on the above example we are able to access the values of the array using indexes, which starts from 0 and go till the arr.length - 1;</p>
<ul>
<li>also we can access the last element of the array by using <code>arr[arr.length - 1]</code> or <code>arr.at(-1)</code></li>
</ul>
<hr />
<p>Now let see how can we modify the values of the array</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/498a2304-85d4-4651-abe2-94a0f40eecb5.png" alt="" style="display:block;margin:0 auto" />

<p>Here on the above example , as you can see i have modified the value of index 5 to empty object and then printed the array and you can see over there it gets modified as empty object.</p>
<hr />
<p>Let's see some intresting case</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/5e506ac6-dd5d-4bc9-a60d-1db385fc96ba.png" alt="" style="display:block;margin:0 auto" />

<p>on the above example as you can see , I have checked the length of array using <code>arr.length</code> and it comes out as 6, but the intresting thing is that what we will get if we try to access the index which is greater than 6 , so i have tried to access the 10th index and guess what i have got <code>undefined</code> as a output, which is pretty obvious, also we will get same output if we try to access the negative indexes.</p>
<hr />
<p>Let's discuss some basic looping in the array</p>
<p>I will write the loop name along with the implemented example for the syntax in this sections</p>
<ol>
<li><p>For loop :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/e4743f2b-a4dc-48da-9f98-a2211af0279e.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p>While loop :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/92f7a9ea-0025-4bde-b682-300a51a065f0.png" alt="" style="display:block;margin:0 auto" />
</li>
<li><p>forEach loop :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/da1a906f-464f-474d-84ea-63c9958d19df.png" alt="" style="display:block;margin:0 auto" /></li>
</ol>
<p>So these are the basic loops that are generally used to iterate over the array.</p>
<hr />
<h3>Try it yourself :</h3>
<ol>
<li><p>Create an array of 5 favorite movies</p>
</li>
<li><p>Print the first and last element</p>
</li>
<li><p>Change one value and print updated array</p>
</li>
<li><p>Loop through the array and print all elements</p>
</li>
<li><p>Also figure out some inbuilt methods of array (like .toReversed, .concat etc)</p>
</li>
</ol>
<hr />
<h3>Conclusion:</h3>
<p>Arrays are one of the most fundamental and useful data structures in JavaScript. They let you group related values under a single variable, access items by numeric indices (starting at 0), and manage large or dynamic collections without creating many separate variables. In JavaScript, arrays can hold values of different types, which makes them flexible for many tasks.</p>
<hr />
<p>Hope you enjoyed reading❤️</p>
]]></content:encoded></item><item><title><![CDATA[08 Array Methods You Must Know]]></title><description><![CDATA[In this blog we are going to cover the important methods that are there in the array , in JS arrays are having some inbuilt methods which are very helpful and frequently used like push() , pop() , shi]]></description><link>https://www.shubhujalablogs.live/array-methods</link><guid isPermaLink="true">https://www.shubhujalablogs.live/array-methods</guid><category><![CDATA[js]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[array]]></category><category><![CDATA[array methods]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Sat, 14 Mar 2026 12:32:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/c072ad49-bbbe-44ed-81a7-dd2b2eaab4d0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this blog we are going to cover the important methods that are there in the array , in JS arrays are having some inbuilt methods which are very helpful and frequently used like push() , pop() , shift() , unshift(), map() and much more.</p>
<p>So in this blog what we are going to do is first we will understand the definition of the method and then we will see some examples of it, so let's proceed with the same</p>
<h3>push &amp; pop</h3>
<p>these methods are used to add or remove the element from the end of the array.</p>
<ul>
<li><p><strong>push</strong> → Insert the element on the end of array</p>
</li>
<li><p><strong>pop</strong> → remove the element from the end of array</p>
</li>
</ul>
<p>Example :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/449a5c75-f656-4460-a344-46dd29a77fdb.png" alt="" style="display:block;margin:0 auto" />

<h3>shift &amp; unshift</h3>
<p>these methods are just opposite of the push and pop , here instead of the end we are inserting and removing the element from the front of the array.</p>
<ul>
<li><p>shift → used to remove the element from the begnning</p>
</li>
<li><p>unshift → used to insert the element in the beginning of the array</p>
</li>
</ul>
<p>Example :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/e898ebaa-1642-471d-83cc-9e50ae06e26f.png" alt="" style="display:block;margin:0 auto" />

<h3>Map</h3>
<p>map is the method in the array which is used in such case when we want to perform some operations on the each element of the array , Suppose you have an array of numbers and you want to increment each value by 10 , then in this case you can use the map to perform your task easily, <mark class="bg-yellow-200 dark:bg-yellow-500/30">one thing that we have to keep in mind is map return new array and doesnot modify the original array.</mark></p>
<p>Syntax of map functions : basically it runs an callback function to modify the values</p>
<pre><code class="language-javascript">array.map(callback(element, index, array), thisArg)
</code></pre>
<p>As you can see the callback function requires 3 parameters</p>
<ol>
<li><p>element - The current element being processed in the array</p>
</li>
<li><p>index(optional) - The index of the current element being processed in the array.</p>
</li>
<li><p>array(optional) - The array <code>map()</code> was called upon.</p>
</li>
</ol>
<p>apart from these parameter one more thing is there that is <code>thisArg</code> which is a value to use as <code>this</code> when executing <code>callbackFn.</code></p>
<p>Example:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/1e68a329-2253-4c10-85ea-12e6f2ac3832.png" alt="" style="display:block;margin:0 auto" />

<p>let's take one example of <code>thisArg</code> as well</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/f509390e-4247-4a78-bbbf-be3b0fdd2b13.png" alt="" style="display:block;margin:0 auto" />

<ul>
<li>Look at the above example , what i have done is i have created one object <code>myObj</code> and inside that i have one key <code>value: 10</code> , then I have used map and on the parameter of the map i have passed the object <code>myObj</code> and inside function I have accessed the value using <code>this</code> keyword, and as a result our array gets modified to new array.</li>
</ul>
<h3>Filter</h3>
<p>filter is the method which is used to filter out the required value from the array , as the name itself is defining, it also takes callback function as an argument , and that callback function returns the boolean value, if the element is there it should returns true means the element should be included in the new filtered array , otherwise it should return false means the element will be excluded , and <mark class="bg-yellow-200 dark:bg-yellow-500/30">one thing that we have to keep in mind is </mark> <code>filter()</code> <mark class="bg-yellow-200 dark:bg-yellow-500/30"> return a new array which includes the filtered element</mark></p>
<pre><code class="language-javascript">array.filter(callback(element, index, array))
</code></pre>
<p>key point -</p>
<ul>
<li><p>it returns new array</p>
</li>
<li><p>if callback return true - include the value</p>
</li>
<li><p>if callback return false - exclude the value</p>
</li>
</ul>
<p>Example:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/c469b044-f291-4bb7-b73d-258cfd708fda.png" alt="" style="display:block;margin:0 auto" />

<ul>
<li>Look at the above example , i have taken one array of numbers and I am filtering out those numbers which are divisible by 2 and hence you can see the results , i got the numbers which are divisible by 2. ( [2, 4 , 6] here)</li>
</ul>
<h3>reduce</h3>
<p>as the name suggests , this method is used to reduce an array into single value. like calculating sum, product etc.</p>
<pre><code class="language-javascript">array.reduce(callback(accumulator, currentValue, index, array), initialValue)
</code></pre>
<p>key points -</p>
<ul>
<li><p>accumulator → it stores the value of previous iteration.</p>
</li>
<li><p>currentValue →current element</p>
</li>
<li><p>initialValue → it stores the initial value of the accumulator</p>
</li>
</ul>
<p>Example:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/20ba70c4-8c56-48c2-b942-92696c560c3b.png" alt="" style="display:block;margin:0 auto" />

<p>Exaplaination →</p>
<ul>
<li><p>acc = 1 → 1*1 = 1 → 1*2 = 2 → 2*3 = 6 → 6*4 = 24 → 24*5 = 120 → 120*6 = 720</p>
</li>
<li><p>result = 720</p>
</li>
</ul>
<h3>forEach</h3>
<p>this method is used to iterate over the array and alow us to perform some operation, it also takes callback function as a argument, main thing to keep in mind it doesnot return new array instead it mutates the original array.</p>
<p>Example :</p>
<img src="https://cdn.hashnode.com/uploads/covers/68c6839f7c0256a7a628c551/0b003400-038d-498a-b2dd-95a415de54e1.png" alt="" style="display:block;margin:0 auto" />

<h3>Conclusion :</h3>
<p>In this post we've looked at some of the most commonly used array operations in JavaScript , how to add and remove elements at the end (push, pop) and at the beginning (shift, unshift), and how to transform arrays element-by-element with map. These methods form the foundation for manipulating collections and are essential in everyday JS programming.</p>
<hr />
<p>Hope you found it useful❤️</p>
]]></content:encoded></item><item><title><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster Markup]]></title><description><![CDATA[Topics to Cover

What Emmet is (in very simple terms)

Why Emmet is useful for HTML beginners

How Emmet works inside code editors

Basic Emmet syntax and abbreviations

Creating HTML elements using Emmet

Adding classes, IDs, and attributes

Creatin...]]></description><link>https://www.shubhujalablogs.live/html-emmets</link><guid isPermaLink="true">https://www.shubhujalablogs.live/html-emmets</guid><category><![CDATA[HTML5]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Emmet]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:57:43 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-topics-to-cover"><strong>Topics to Cover</strong></h2>
<ol>
<li><p>What Emmet is (in very simple terms)</p>
</li>
<li><p>Why Emmet is useful for HTML beginners</p>
</li>
<li><p>How Emmet works inside code editors</p>
</li>
<li><p>Basic Emmet syntax and abbreviations</p>
</li>
<li><p>Creating HTML elements using Emmet</p>
</li>
<li><p>Adding classes, IDs, and attributes</p>
</li>
<li><p>Creating nested elements</p>
</li>
<li><p>Repeating elements using multiplication</p>
</li>
<li><p>Generating full HTML boilerplate with Emmet</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[CSS Selectors 101: Targeting Elements with Precision]]></title><description><![CDATA[First of all let's discuss why do we need CSS? Just take a simple example , let say you have created a navbar using HTML and you have added all the functionalities in it but without CSS this is how your navbar will looks like will looks like

from an...]]></description><link>https://www.shubhujalablogs.live/css</link><guid isPermaLink="true">https://www.shubhujalablogs.live/css</guid><category><![CDATA[CSS]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[basics]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:55:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769951265555/eb752517-bbec-4f24-95b5-c2f889d1f8de.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>First of all let's discuss why do we need CSS? Just take a simple example , let say you have created a navbar using HTML and you have added all the functionalities in it but without CSS this is how your navbar will looks like will looks like</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ktd4rd5ow731nwa2t7cg.png" alt="before-CSS" /></p>
<p>from any angle is it looks like nav bar? NO, right now let's apply some CSS in it</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hth63h5m9530yab2o4z.png" alt="after-CSS" /></p>
<p>Now see which feels more engaging , obiously second one means after applying CSS, that's why we need CSS to style the webpages.</p>
<h2 id="heading-now-lets-discuss-the-technical-definition-of-css">Now let's discuss the technical definition of CSS</h2>
<ul>
<li>CSS stands for Cascading Style Sheets, here Cascading term means overriding, this is exactly what we are doing We are overriding the default properties of HTML tags given by browser, and Yes we do have special name for the styling given by browser which is known as User Agent Style.</li>
</ul>
<h2 id="heading-how-to-give-styles-in-css">How to give styles in CSS</h2>
<ul>
<li>We are giving styling in CSS using selectors.</li>
</ul>
<h2 id="heading-what-are-selectors">What are Selectors?</h2>
<ul>
<li>Selectors name itself is defining it's definition, basically it is used to select the elements to give styling to them, there are mainly 4 ways to select the element :</li>
</ul>
<h3 id="heading-1-element-selector">1. Element Selector</h3>
<ul>
<li><p>with the help of element selector , we can target a particular element by using HTML tag and apply the styling in that particular element also we can also apply the styling to it's child element let see how :</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iia6ifp0akf1yet1ltvh.png" alt="element selecor" /></p>
<p>  Here you can see in HTML file , we have a <code>&lt;nav&gt;</code> tag and we have applied the styling to nav tag, so this is how using element selector we can apply the styling. Also We can also apply the stylings to the child elements of any tag using element tag</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32zs0cks0434fcx4ea7n.png" alt="Child-styling" /></p>
<p>  Here you can see we have two child elements <code>&lt;h3&gt; &lt;h4&gt;</code> of <code>nav</code> so this is how we are able to apply the stylings to the child element using element tag.</p>
</li>
</ul>
<p><strong>Where it fails?</strong> When we have multiple same elements inside the parent elements and we don't want to apply the stylings to all elements , this is where it fails Example :</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73z3pe2p4rvzhb2179wq.png" alt="name-selector" /></p>
<p>Here you can see we want different styles for each child of <code>&lt;nav&gt;</code> element but by using the element tag we are unable to do that.</p>
<h3 id="heading-2-class-selectors">2. Class Selectors</h3>
<ul>
<li><p>Earlier , using element tag we were not able to give the different styling when we have multiple childs , so class selectors solves this problem for us, basically we have to give different classes to our HTML tag and by using class selectors we can apply different styling for each tags. Let' implement it practically</p>
</li>
<li><p>Syntax to use class selector, We have to use dot(.) in front of the class name and then apply styling , you can refer the example's syntax below</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lwoue2nalmvhtpuxx3x.png" alt="class-selector" /></p>
</li>
</ul>
<p>Also we can give multiple class names to tag seperated by spaces like this <code>class = "main div1"</code>, and the corresponding styles that we have given is going to applied.</p>
<h3 id="heading-3-id-selectors">3. ID Selectors</h3>
<ul>
<li><p>It is another way to target HTML tags to give styling, an ID is used to uniquelly identify any tag so it is generally recommneded to use different id names for multiple tags, you can use same names as well there is no issue with that also.</p>
</li>
<li><p>Syntax to use ID selectos, We have to use <code>#</code> before the name of id , refer the below example's syntax</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bzgsskww87p1q13z7mh.png" alt="ID-selectors" /></p>
</li>
</ul>
<h3 id="heading-4-universal-selector">4. Universal Selector (*)</h3>
<ul>
<li><p>With the help of universal selectors we can apply the styling to the entire documents, Syntax to use universal selector</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55ka2knioeno3l3xgzwh.png" alt="Universal Selector" /></p>
<p>  Example :</p>
<p>  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w116est646qddsatdcq.png" alt="Universal Selector" /></p>
<p>  Here you can see I haven't targeted any particular element instead i have just written (*) and apply the styling and it is getting applied on the whole document this is how universal selectors works.</p>
</li>
</ul>
<h3 id="heading-grouping-css-selectors">Grouping CSS selectors</h3>
<p>By grouping means, if we want to apply the same styling to the different elements so without grouping we have to write is again and again but with the help of grouping we just have to write it once and done, CSS is going to be applied on all the different elements.</p>
<p>Now let's see the syntax for grouping the element in CSS We have to use it like this (refer images) Examples : 1. using element tags only</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mj97o0jve7fw6qg93tv2.png" alt="example-1" /></p>
<p>2. when we have classes and id's with element (generally we have it) then this is how it should be done.</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yw7v4we7lwzvbf3fsvg4.png" alt="example-2" /></p>
<h3 id="heading-descendant-css-selectors">Descendant CSS selectors</h3>
<p>By decendent selector means, We are giving styles to the elements which are present inside other elements Example :</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vu78ckhwk5xg03l7pz23.png" alt="decendent-selector" /></p>
<p>In the above example we are targetting the h2 tag whose path is like this</p>
<p><code>Main -&gt; div -&gt; h2</code></p>
<p>that's why while using decendant selector we have used <code>main div h2</code> means we have to go to the main tag inside that we have to go to div and inside div finnaly we have to style h2</p>
<p>So this is how it works in CSS.</p>
<h2 id="heading-basic-selector-pripority-in-css">Basic selector pripority in CSS</h2>
<p>As we have discussed the way of styling the element in CSS, so there is one question suppose we have applied the styling to using (*) universal selectors</p>
<pre><code class="lang-bash"> * {
    color: yellow;
   }
</code></pre>
<p>and also we have one div in which some text is there and in the div also we have applied the styling like this</p>
<pre><code class="lang-bash"> .div{
    color : red;
 }
</code></pre>
<p>Then what should be the color of the content in the div? will it be yellow or black? let see : In this example we have used universal selector to give text-color</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ke0lrn0iixvsy5i9rpe4.png" alt="before" /></p>
<p>But ass soon as we have given the styling using class selector it's color changes from yellow to red.</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkx646zhh59co0203ov5.png" alt="After" /></p>
<p>let's add one id to it and let's again try to change the text color using id selector</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9tzi3conb0m1fjqxltqh.png" alt="id" /></p>
<p>That's crazy now it is showing pink color , means id is having more priority than class selectors , and class is having more priority than universal , means there must be a priority in CSS.</p>
<p>here is the priority list</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4f94mvhq5np3095ar6nl.png" alt="priority" /></p>
<p>[ref of image : GeekForGeeks]</p>
<hr />
<p>Hope you enjoyed reading.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding HTML Tags and Elements]]></title><description><![CDATA[Topics to Cover

What HTML is and why we use it

What an HTML tag is

Opening tag, closing tag, and content

What an HTML element means

Self-closing (void) elements

Block-level vs inline elements

Commonly used HTML tags]]></description><link>https://www.shubhujalablogs.live/html-tags</link><guid isPermaLink="true">https://www.shubhujalablogs.live/html-tags</guid><category><![CDATA[HTML5]]></category><category><![CDATA[tags]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:53:26 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-topics-to-cover"><strong>Topics to Cover</strong></h3>
<ol>
<li><p>What HTML is and why we use it</p>
</li>
<li><p>What an HTML tag is</p>
</li>
<li><p>Opening tag, closing tag, and content</p>
</li>
<li><p>What an HTML element means</p>
</li>
<li><p>Self-closing (void) elements</p>
</li>
<li><p>Block-level vs inline elements</p>
</li>
<li><p>Commonly used HTML tags</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Inside Git: How It Works and the Role of the .git]]></title><description><![CDATA[Introduction: Why Understanding Git Internals Matters
Have you ever wondered what a Version Control System really is and what problems it solves?
If you are new to development, having a solid understanding of Git is extremely important not just the c...]]></description><link>https://www.shubhujalablogs.live/git-internals</link><guid isPermaLink="true">https://www.shubhujalablogs.live/git-internals</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[Internals]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:51:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769784066679/4a1547ad-fd74-4352-a560-19754ff255d6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-why-understanding-git-internals-matters">Introduction: Why Understanding Git Internals Matters</h2>
<p>Have you ever wondered what a <strong>Version Control System</strong> really is and what problems it solves?</p>
<p>If you are new to development, having a <strong>solid understanding of Git</strong> is extremely important not just the commands, but <strong>how Git works internally</strong>. Once you understand <em>what Git is doing behind the scenes</em>, the commands start making sense automatically.</p>
<p>Before diving into Git internals, let’s first understand <strong>why Git exists at all</strong>.</p>
<hr />
<h3 id="heading-understanding-the-git-folder">Understanding the <code>.git</code> Folder</h3>
<p>A git repository contains:</p>
<ul>
<li><p>Your Project files</p>
</li>
<li><p>A hidden .git folder that stores the history and metadeta</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769783683906/82d09845-1c70-4af1-8bd3-b6fe24f02560.png" alt class="image--center mx-auto" /></p>
<p>  This folder stores :</p>
<ul>
<li><p>Complete project history</p>
</li>
<li><p>All commits</p>
</li>
<li><p>Branch information</p>
</li>
<li><p>Git configuration</p>
</li>
</ul>
</li>
</ul>
<hr />
<h2 id="heading-git-objects-blob-tree-commit-core-internals">Git Objects: Blob, Tree, Commit (Core Internals)</h2>
<p>Git stores everything as <strong>objects</strong>.</p>
<ol>
<li><p>Blob → Stores the <strong>content of a file</strong>, not the filename.</p>
</li>
<li><p>Tree → Represents a <strong>directory structure</strong>, linking filenames to blobs.</p>
</li>
</ol>
<p>Commit → A commit object points to :</p>
<ul>
<li><p>A tree (project structure)</p>
</li>
<li><p>Parent commit(s)</p>
</li>
<li><p>Author information</p>
</li>
<li><p>Commit message</p>
</li>
</ul>
<hr />
<h2 id="heading-how-git-tracks-changes-git-add-amp-git-commit">How Git Tracks Changes (git add &amp; git commit)</h2>
<h3 id="heading-what-happens-during-git-add">What Happens During <code>git add</code>?</h3>
<ul>
<li><p>Git takes file content</p>
</li>
<li><p>Converts it into blobs</p>
</li>
<li><p>Places references into the staging area</p>
</li>
</ul>
<h3 id="heading-what-happens-during-git-commit">What Happens During <code>git commit</code>?</h3>
<ul>
<li><p>Git creates a commit object</p>
</li>
<li><p>Stores the snapshot permanently</p>
</li>
<li><p>Links it to previous commits</p>
</li>
</ul>
<p>This is how Git builds a <strong>timeline of your project</strong>.</p>
<hr />
<h2 id="heading-how-git-uses-hashes-for-integrity">How Git Uses Hashes for Integrity</h2>
<p>Every Git object is identified using a <strong>SHA-1 hash</strong>.</p>
<p>This ensures:</p>
<ul>
<li><p>Data integrity</p>
</li>
<li><p>No accidental modification</p>
</li>
<li><p>Secure history tracking</p>
</li>
</ul>
<p>If even <strong>one character changes</strong>, the hash changes, This is why Git history is <strong>reliable and tamper-proof</strong>.</p>
<hr />
<h2 id="heading-branches-overview">Branches Overview</h2>
<p><img src="https://wac-cdn.atlassian.com/dam/jcr:a905ddfd-973a-452a-a4ae-f1dd65430027/01%20Git%20branch.svg?cdnVersion=3145" alt="Git branch" /></p>
<p>The diagram above shows a repository with two separate development lines, allowing parallel work on a small feature and a longer-running feature in branches, while keeping the <code>main</code> branch free of unstable code.</p>
<hr />
<h2 id="heading-fun-fact"><strong>Fun Fact! 🙂</strong></h2>
<blockquote>
<p><strong><em>Git was a side project of <mark>Linus Torvalds</mark>, the creator of the Linux operating system kernel. He started developing Git in April 2005 to manage the Linux kernel source code</em></strong></p>
<p><strong><em>Linus Torvalds designed Git in just ten days with specific goals in mind, including speed, support for distributed development, and data integrity. He intended it to be a temporary solution but it quickly evolved into the dominant version control system used worldwide today.</em></strong></p>
</blockquote>
<p>Thanks for reading</p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Topics to cover

Why Version Control Exists

The Pendrive Analogy in Software Development

Problems Faced Before Version Control Systems


Have you ever wondered ,what exactly is Version Control System or what are the problems it solves? if you are n...]]></description><link>https://www.shubhujalablogs.live/git-pendrive-problem</link><guid isPermaLink="true">https://www.shubhujalablogs.live/git-pendrive-problem</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[PendriveProblem]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:48:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769783435533/aed00107-932d-4ee1-bda5-e821511bdb3f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-topics-to-cover"><strong>Topics to cover</strong></h2>
<ol>
<li><p>Why Version Control Exists</p>
</li>
<li><p>The Pendrive Analogy in Software Development</p>
</li>
<li><p>Problems Faced Before Version Control Systems</p>
</li>
</ol>
<p>Have you ever wondered ,what exactly is Version Control System or what are the problems it solves? if you are new to it then it is very important for a developer to have a solid understanding of git.</p>
<p>At its core, <strong>Git is a version control system that helps developers track changes in their code over time</strong>. But that definition alone doesn’t explain <em>why</em> Git exists. To understand that, we need to look at how developers managed code <strong>before</strong> version control systems.</p>
<hr />
<h2 id="heading-life-before-version-control-systems">Life Before Version Control Systems</h2>
<p>Before tools like Git existed, managing and sharing code in a team was extremely difficult. Developers relied on very manual and error-prone methods such as:</p>
<ul>
<li><p>Copying code to <strong>pendrives</strong></p>
</li>
<li><p>Sending projects via <strong>email</strong></p>
</li>
<li><p>Creating folders like:</p>
<ul>
<li><p><code>project_final</code></p>
</li>
<li><p><code>project_final_v2</code></p>
</li>
<li><p><code>project_latest_final_really</code></p>
</li>
</ul>
</li>
<li><p>Manually telling teammates what changes were made</p>
</li>
</ul>
<p>These methods worked only for very small projects and even then, barely.</p>
<p>There was <strong>no reliable way to answer basic questions</strong>, such as:</p>
<ul>
<li><p>What exactly changed in the code?</p>
</li>
<li><p>Who made those changes?</p>
</li>
<li><p>When were the changes made?</p>
</li>
<li><p>What was the previous working version?</p>
</li>
</ul>
<p>As a result, teams frequently faced issues like:</p>
<ul>
<li><p><strong>Overwriting someone else’s code</strong></p>
</li>
<li><p><strong>Losing important changes</strong></p>
</li>
<li><p><strong>No history of the codebase</strong></p>
</li>
<li><p><strong>No clear ownership of changes</strong></p>
</li>
</ul>
<hr />
<h3 id="heading-lets-take-one-example-to-eleborate-more-about-this-problem"><strong>Let’s take one example to eleborate more about this problem</strong></h3>
<p>Here's an example using a pen drive to share code between two developers (developer-1 and developer-2).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767036103585/8bb3cf5c-513e-48a6-86e7-695ef5f27804.png" alt /></p>
<p>In the above image is is showing that -</p>
<p>Let's say developer-1 has written some code and needs help with a feature he can't develop. So, he decides to ask developer-2 for assistance. He zips his code, puts it on a pendrive, and sends it to his friend (developer-2). Developer-2 reviews the code, adds the feature, and then needs to do the same steps again. He zips the updated code and sends it back to developer-1. The problem is, how does developer-1 know which lines developer-2 changed? He would have to ask developer-2 about the changes made in the code. and again untill they have done with there works they have to repeat this process again and again , So you can see this much dificulty is there just between the 2 developer now imagine when there are more than 2 developers then what will happen?</p>
<p>So , basically the problem is that we are not able to track the changes made by the developers if we somehow able to track the changes then it is very easy to manage the code. Thats why version control systems like <code>git</code> come into the picture.</p>
<hr />
<h2 id="heading-why-version-control-becomes-mandatory">Why Version Control Becomes Mandatory</h2>
<p>This is exactly why <strong>Version Control Systems</strong> came into existence.</p>
<p>Tools like <strong>Git</strong> solve these problems by:</p>
<ul>
<li><p>Automatically tracking every change</p>
</li>
<li><p>Maintaining a complete history of the project</p>
</li>
<li><p>Allowing multiple developers to work simultaneously</p>
</li>
</ul>
<p>In modern software development, version control is <strong>mandatory</strong> for day to day use . Git didn’t become popular by chance , it became popular because it solved problems that every developer and every team inevitably faces.</p>
<hr />
<p>Hope you enjoyed reading.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[Have you ever wondered ,what exactly is Version Control System or what are the problems it solves? if you are new to it then it is very important for a developer to have a solid understanding of git.
What is Git?

it is a version control system which...]]></description><link>https://www.shubhujalablogs.live/git-basics</link><guid isPermaLink="true">https://www.shubhujalablogs.live/git-basics</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:44:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769782582016/ce086336-9731-40b6-a652-b4eadfe7b20b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Have you ever wondered ,what exactly is Version Control System or what are the problems it solves? if you are new to it then it is very important for a developer to have a solid understanding of git.</p>
<h3 id="heading-what-is-git">What is Git?</h3>
<ul>
<li>it is a version control system which keeps track of all the changes that we have made in the codebase.</li>
</ul>
<h2 id="heading-understanding-usecase-of-git"><strong>Understanding Usecase of Git</strong></h2>
<ol>
<li><p><mark>Track of Code changes </mark> → Git keeps track of every changes made in the codebase even a single (.)</p>
</li>
<li><p><mark>Collaborations </mark> → Multiple developers can work on a single project without overwriting the code.</p>
</li>
<li><p><mark>Undo Chnages</mark> →It gives you freedom to work without fear , means if something wents wrong then there is always a way to get back.</p>
</li>
</ol>
<h2 id="heading-git-terminologies"><strong>Git Terminologies</strong></h2>
<p>before moving to the commands we must have to understand some basic terminologies which we have to use while working with the git</p>
<ol>
<li><p><mark>Repositiory </mark> → Commanly called as Repo. it is a project folder which is tracked by git.</p>
</li>
<li><p><mark>Staging Area</mark> → This is where you prepare the changes before saving them permanently.</p>
</li>
<li><p><mark>Commit</mark> → commit is a snapshot of your project at a specific moment. thing to know is Each commit has it’s own Unique ID, and also message about that commit</p>
</li>
<li><p><mark>Working Directory </mark> →The Working Directory is the place where Git puts the project files so you can view, edit, and work on them. Any changes you make here are unstaged until you add them.</p>
</li>
<li><p><mark>Branch </mark> → it allows to work on your own feature wihtout interfaring with the actual code.</p>
</li>
<li><p><mark>Head </mark> → Head points to your current location in the project history. it tells git where you are right now on which specific commit or branch</p>
</li>
</ol>
<h3 id="heading-basic-git-commands"><strong>Basic git commands →</strong></h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Command</td><td>What it Does?</td><td>What it tells?</td></tr>
</thead>
<tbody>
<tr>
<td><code>git init</code></td><td>Initializes a new git repository</td><td>Starting new project or want git to track files</td></tr>
<tr>
<td><code>git status</code></td><td>Shows the current status of your code</td><td>Modified files, Staged files, Untracked files</td></tr>
<tr>
<td><code>git add "file_name"</code> or <code>git add .</code></td><td>Adds file to Staging area</td><td>When you add the files to the staging area</td></tr>
<tr>
<td><code>git commit -m “message“</code></td><td>Saves a snapshot of staged changes</td><td>commited files along with the messages</td></tr>
<tr>
<td><code>git log</code></td><td>Shows the commit history</td><td>Commit ID, Author, Date, Commit message</td></tr>
</tbody>
</table>
</div><h3 id="heading-developers-workflow-using-git"><strong>Developer’s workflow using git →</strong></h3>
<p>Step 1: Create Project</p>
<pre><code class="lang-bash">mkdir project_name
<span class="hljs-built_in">cd</span> project_name
</code></pre>
<p>Step 2: Initialize Git</p>
<pre><code class="lang-bash">git init
</code></pre>
<p>Step 3: Create Files</p>
<pre><code class="lang-bash">touch main.txt README.md
</code></pre>
<p>Step 4: Check Status</p>
<pre><code class="lang-bash">git status  // shows the files are untracked
</code></pre>
<p>Step 5: Stage the file</p>
<pre><code class="lang-bash">git add main.txt
</code></pre>
<p>Step 6: Make some changes and Commit the changes</p>
<pre><code class="lang-bash">git add .
git commit -m <span class="hljs-string">"feature 1 created"</span>
</code></pre>
<p>So this is how developers are working daily.</p>
]]></content:encoded></item><item><title><![CDATA[Beginner's Guide to How Browsers Function: Exploring Browser Internals]]></title><description><![CDATA[First of all let’s Understand about browser and then move towards the internals of the browser.
What is Browser
Browser is a rendering platform that talks to the server, that renders the documents and download files , images and also able to understa...]]></description><link>https://www.shubhujalablogs.live/browser-internals</link><guid isPermaLink="true">https://www.shubhujalablogs.live/browser-internals</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Browsers]]></category><category><![CDATA[Behind-the-scenes ]]></category><category><![CDATA[Browser Internals]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 13:38:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780206286/c7c4047d-7871-401f-85d2-536b286b0b78.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>First of all let’s Understand about browser and then move towards the internals of the browser.</p>
<h2 id="heading-what-is-browser">What is Browser</h2>
<p>Browser is a rendering platform that talks to the server, that renders the documents and download files , images and also able to understand those files and what not , it is like a whole OS which works in the world of networking.</p>
<p>Example of browsers → Chrome, Microsoft Edge, Brave, FireFox, Safari etc.</p>
<h2 id="heading-high-level-overview-of-browser">High level Overview of browser</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769722879904/35f33b1f-7cf6-4bce-93ec-6ef2b6fc4353.png" alt /></p>
<ol>
<li><p><strong>User Interface</strong> (UI) : Everything that you see and interacts with except the webpage itself, like groups , collections , bookmarks and themes . Each browser can have differenct user Interface and fatures.</p>
</li>
<li><p><strong>Browser Engine :</strong> The browser engine is responsible for the content that is fetched from the server and user interactions. it keeps track of all the actions that is being performed by the user like which button is clicked, which url is asked to parse, and how the content will be displayed on the browser.</p>
</li>
<li><p><strong>Rendering Engine</strong> : it is responsible for the rendering of the web content , in most of the browsers both the browsing engine and the rendering engine work togetner to provide the better results to the user/client .</p>
<p> <mark>Common rendering engines</mark> → Blink(chrome, edge, brave) , webkit (safari) , Gecko(Firefox)</p>
</li>
<li><p><strong>Networking Layer</strong> : This layer handles the communication part with the server , Like when user click on any url or searched for any url on the browser this network layer iniitate an HTTP request to the webserver to loas the requested website, it is also manages to fetch the content from HTML, CSS files or even images as well.</p>
</li>
<li><p><strong>JavaScript Engine</strong> : browsers have inbuilt JavaScript engine which help them to understand and interpret JavaScript codes, these engines help to convert the javaScript codes into computer-understandable language.</p>
<p> <mark>Common javaScript Engine</mark> → V8(chrome), chakra (Edge), spider Monkey(Firefox), JavaScript Core Webkit (Safari).</p>
</li>
<li><p><strong>Data Storage</strong> → One part of the browser goes into stroring various types of data which includes user preferences like theme mode , browsing history, password and other personal informations.</p>
</li>
<li><p>UI Backend → this is responsible for providing the dynamic and interactive behaviour on the web page and enhance overall functionality and performance of the browser.</p>
</li>
</ol>
<p>This is the high-level architecture of web browser which works together to display us a whole properly working website.</p>
<h3 id="heading-browser-engine-vs-rendering-engine-high-level">Browser Engine Vs Rendering Engine (high level) :</h3>
<p><strong>The Browser engine:</strong> marshals actions between the UI and the rendering engine.</p>
<p><strong>The rendering engine:</strong> responsible for displaying requested content. For example if the requested content is HTML, the rendering engine parses HTML and CSS, and displays the parsed content on the screen.</p>
<h2 id="heading-html-parser-amp-dom">HTML Parser &amp; DOM</h2>
<ul>
<li><p>HTML parser is used to parse the HTML content which is done by the rendering engine of the browser.</p>
</li>
<li><p>DOM → stands for Document Object model, basically we can imagine collections of our HTML tags as a tree, because after parsing is done by the rendering engines we get Nodes and with the help of these Node , we are able to generate DOM tre</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769778489021/942fa0e8-032f-428e-8bf4-68812366d138.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<h2 id="heading-css-parser-amp-cssom-tree">CSS Parser &amp; CSSOM Tree</h2>
<ul>
<li><p>During the parsing of HTML , rendering engine notices the Link tag which is fo CSS file and get the CSS file after that it also parses the CSS with CSS parser</p>
</li>
<li><p>CSSOM → stands for CSS Object Model, it is a set of APIs that allowing manipulation of CSS from javaScript, it is similar to DOM, but for the CSS rather than HTML. It allows users to read and modify CSS style dynamically.</p>
</li>
</ul>
<h2 id="heading-how-dom-and-cssom-come-together">How DOM and CSSOM come together</h2>
<p>(DOM)Document object model and CSSOM (CSS Object Model) come together to form the rendering tree, which is used by the browser to display the web page content to the screen of the user.</p>
<p>How this is done in following steps :</p>
<ul>
<li><p>DOM Construction → browser parse the HTML and constructs the DOM tree.</p>
</li>
<li><p>CSSOM Construction → after the construction of the DOM tree , browser processes the CSS and build CSSOM tree.</p>
</li>
<li><p>Render Tree Formation → the browser then combines the independent DOM ans CSSOM tree into a single render tree</p>
</li>
<li><p>Layout (Reflow) → once the rendering tree is completed , the browser starts the layout process , this steps calculates the exact position and geometric size of each elements,</p>
<p>  here the conversion of the relative measurements into absolute pixels happens.</p>
</li>
<li><p>Paint → Finally , the browser paints the individual nodes to the screen using the layout information to render the pixels and display the visual content to the user</p>
</li>
</ul>
<h2 id="heading-understanding-parsing-using-simple-maths-example">Understanding Parsing Using Simple Maths Example</h2>
<p>Parsing in browser is a process to convert the raw text into tree like structure that is understandable for browser , and by using this tree browser can perform rendering.</p>
<p>Example : 5 + 7 * 9 + 7</p>
<p>firstly tokenization(breaking into pieces) takes place :</p>
<ul>
<li><p>5 → Number</p>
</li>
<li><p>+ → Operator</p>
</li>
<li><p>7 → Number</p>
</li>
<li><p>* → Operator</p>
</li>
<li><p>9 → Number</p>
</li>
<li><p>+ → Operator</p>
</li>
<li><p>7 → Number</p>
</li>
</ul>
<p>tree formation : this is how tree will looks like</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780078375/dfee56de-891a-43c6-a73f-41c6a6ffe4a1.png" alt class="image--center mx-auto" /></p>
<hr />
<p>Hope you enjoyed reading.</p>
]]></content:encoded></item><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[Before moving with TCP protocol, have you ever think about why all these rules are made? can’t we just simply send our data without any rules?
The Answer to this questions is No, we can’t just send the data on the network without rules , if we do the...]]></description><link>https://www.shubhujalablogs.live/tcp</link><guid isPermaLink="true">https://www.shubhujalablogs.live/tcp</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[TCP]]></category><category><![CDATA[3-way handshake]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 12:02:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769774477647/3d20af62-22bf-4c23-bb8a-8c771ad499fb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before moving with TCP protocol, have you ever think about why all these rules are made? can’t we just simply send our data without any rules?</p>
<p>The Answer to this questions is No, we can’t just send the data on the network without rules , if we do then</p>
<ul>
<li><p>data will become just random bits , means suppose you have send something to you friend without any protocols then if the message is sent succefully , you friend will not able to understand from where the message starts, where it ends , Like receiving a long string of letters with <strong>no spaces, no punctuation, no language</strong>.</p>
</li>
<li><p>without protocols sender doesn’t know wether it sends successfully or not, reciever can’t ask for missing data because again if reciever tries to ask for a missing data again without protocols some random data bit will gets generated and again the same issue will arise.</p>
</li>
</ul>
<p>That’s why we need some rules (protocols) to send the data properly and here comes the concept of TCP.</p>
<h2 id="heading-what-is-tcp-and-why-it-is-needed">What is TCP and why it is needed?</h2>
<p>TCP(Transmission control protocol) is a protocol that allows devices to communicate reliably over a network, it ensures that data reaches the destination correctly and in right order, so that sender and reciever can make a reliable connection and able to send data to each other without worring about reliabliity. it also ensures that data reaches the destination correctly and in the right order , even if parts of network are slow or unreliable.</p>
<h3 id="heading-problems-it-solves-is">Problems it solves is</h3>
<ul>
<li><p>Data Loss → it ensures that these is no data loss while traveling accross networks.</p>
</li>
<li><p>Order of data → it ensures that data that send by the sender is recieved in the same order by reciever.</p>
</li>
<li><p>Duplicate data → it ensures that no duplicate data sends in the network.</p>
</li>
<li><p>Data corruption → Bits can be flipped during transmission, but TCP ensures that no bit is flipped using checkSum</p>
</li>
</ul>
<h3 id="heading-what-is-the-tcp-3-way-handshake">What is the TCP 3-Way Handshake</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769667484678/93b42836-38df-4b37-b12f-1c52897221c2.png" alt /></p>
<p>TCP establishes a connection between a client and the server before sending any data, this is done using a process calles three-way handshake</p>
<ol>
<li><p>SYNC (synchronize) → client sends a SYN segment to the server, and ask “<em>hey, I want to make a connection“</em></p>
</li>
<li><p>SYNC-ACK (Synchronize-Acknowledge) → The server responds back to the client with a SYN-ACK segment and say “<em>ok let’s make a connection</em>“</p>
</li>
<li><p>ACK (Acknowledge) → The client replies with a ACK, saying “<em>done. connection is established.“</em></p>
</li>
</ol>
<p>This is how 3-way Handshake process takes place.</p>
<h2 id="heading-how-data-transfer-works-in-tcp">How data transfer works in TCP</h2>
<ol>
<li><p><strong>3-Way Handshake</strong> → Before sending any data TCP establishedd a connection between client and server for secure and reliable data transfer</p>
</li>
<li><p><strong>Segmenting</strong> → When an application sends data (like an email) , TCP breaks that data into small chunks called segments. this makes it easier to send large amount of data over the network reliably.</p>
<ul>
<li><p>Each segment has header containing information like sequence number, ports and flags</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769667853880/8dabe600-e330-455e-8998-cabb034c56a1.png" alt /></p>
</li>
</ul>
</li>
<li><p><strong>Routing via IP</strong> → once TCP creates segments of data they are handed to IP and IP is responsible for delievering the segments from the client to the server.</p>
</li>
<li><p><strong>Acknowladgments (ACKs)</strong> → the reciever(client) sends an ACKs for every segment and this tells the sender that data has arrived safely , Suppose if ACKs is not revieved , TCP assumes that the segment was lost and triggers retransmission.</p>
</li>
<li><p><strong>Retransmission</strong> → if sender doesnt recieve an acknowledgment within a certain time then it resends the missing segment, This ensures no data is lost making TCP reliable.</p>
</li>
<li><p><strong>Flow &amp; Error Control →</strong></p>
<ul>
<li><p>Flow Control : TCP prevents the sender from sending too much data too quickly for the server to handle.</p>
</li>
<li><p>Error Control : TCP checks for corrupt segment using checksums and request transmission if needed.</p>
</li>
</ul>
</li>
</ol>
<p>Together, these mechanisms ensure data is delivered reliably and efficiently, without overloading the network or the receiver.</p>
<h2 id="heading-how-tcp-connection-is-closed">How TCP connection is closed</h2>
<p>For closing a TCP connection , we require a process call 4-way Handshake , to ensure that both sides finish transmitting data safely</p>
<ol>
<li><p>FIN (Finish) → the client who want to close the connection send a FIN segment to the server.</p>
</li>
<li><p>ACK (Acknowledge) → the server acknowledges the FIN with an ACK.</p>
</li>
<li><p>FIN (Finish) from Server → the server then sends its own FIN segment when it is ready to close the connection.</p>
</li>
<li><p>ACK (Acknowledge) → the client responds with the ACK, finishing the termination.</p>
</li>
</ol>
<p>This ensures that all the remaning data is securly transmittes before the connection is fully terminated.</p>
<h2 id="heading-applications-of-tcp">Applications of TCP</h2>
<ol>
<li><p><strong><mark>File transfer </mark></strong> : Transferring a file over a network is such a big task because it contains a large amount of data, TCP breakes the large files into small pieces and sends them one by one and then put them back into the correct order at the recievers end and resends any piece that gets lost .</p>
</li>
<li><p><strong><mark>Email </mark> :</strong> Sending email or revieving them requires that all the data must be complete and to the point that why TCP is used here.</p>
</li>
<li><p><strong><mark>Web Browsing </mark> :</strong> Websites sends or recieves data in chunks which is called packets , TCP ensures that all the packets arrives completely and in order that’s how pages of the webpage loads correctly without missing images or broken content.</p>
</li>
</ol>
<hr />
]]></content:encoded></item><item><title><![CDATA[Beginner's Guide to Using cURL: Simple Steps to Start Now]]></title><description><![CDATA[Before starting with cURL let’s first understand about the Server. So what exaclty is Server , it is basically a device or computer whose job is to recieve requests , process them and send back response

For example : it is same like when we opens th...]]></description><link>https://www.shubhujalablogs.live/curl-basics</link><guid isPermaLink="true">https://www.shubhujalablogs.live/curl-basics</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[cURL for beginner]]></category><category><![CDATA[basics]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 10:51:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769770227838/e7f2cb87-78f5-4b3f-8bcf-a84890f42295.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before starting with cURL let’s first understand about the <strong>Server.</strong> So what exaclty is Server , it is basically a device or computer whose job is to <mark>recieve requests , process them and send back response</mark></p>
<ul>
<li>For example : it is same like when we opens the web page at that time also browser sends the request to the server and server sends back HTML, CSS , JS , images and all the data of that webpage and then we are able to access the website</li>
</ul>
<h2 id="heading-what-is-curl">What is cURL ?</h2>
<p>cURL is basically a tool that let you talks to server directly using your terminal mean you dont have to go to the browser to send the request to server.</p>
<p>like very simple we simply have to tell cURL where we have to send the request and what kind of request it is and boom it shows you all the things that server replies back.</p>
<h2 id="heading-why-programmers-need-curl">Why programmers need cURL</h2>
<p>As a developer , specially when we are dealing with the backend side then we generaly don’t want to go to browser again and again or we always dont want a UI , frontend . What we want is to test some APIs , Debug server responses and check if a server is alive or not. that why when we use <mark>cURL</mark> , we can directly talk to server, test our APIs and what not that’s why programmers need cURL.</p>
<h2 id="heading-our-first-curl-request">Our First cuRL request</h2>
<p>let’s start with the demo how can we send the curl reques</p>
<pre><code class="lang-bash">curl https://chaicode.com
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769766851174/6db2ca94-eab9-4537-8c62-5c722868896b.png" alt class="image--center mx-auto" /></p>
<p>Like here you can see we have made a cURL request to the server of chaicode.com by using cURL and <mark>as a response we got the HTML page</mark>, and cURL printed whole response into our terminal that is how we can make request to the server, thing to notice it cURL don’t render the page or haven’t applied any CSS it only showd us raw data returned by the server.</p>
<h2 id="heading-understanding-request-and-response">Understanding request and response</h2>
<ol>
<li><p><strong><mark>Request </mark></strong> → Sent’s by the client , which can be through browser or using cURL</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769767483791/2243c9dd-5661-44cb-957b-ff5245ed6a80.png" alt class="image--center mx-auto" /></p>
<p> like in this example i have sent the request through my browser to ther server of chaicode.com,so this is how a request can be sent.</p>
</li>
<li><p><mark>Response </mark> → Sent by the server , which is Data (HTML, CSS, JSON etc</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769767881335/9296be1b-6105-4179-b5e7-a93dd8152ee7.png" alt class="image--center mx-auto" /></p>
<p> like we have sent the request to chaicode.com and as a response you can see we have got the landing page of the website.</p>
</li>
</ol>
<h2 id="heading-understanding-http-methods-get-and-post">Understanding HTTP Methods : GET and POST</h2>
<ol>
<li><p>GET request → GET itself is defining we are getting something , mean by using this method we are Asking for the data from the server , used while fetching data</p>
<ul>
<li>NOTE : when we are sending request through cURL by default it is GET request.</li>
</ul>
</li>
</ol>
<p>    Example :</p>
<pre><code class="lang-bash">    curl https://api.myapp.com/users
</code></pre>
<ol start="2">
<li><p>POST request → it is used when we want to send data to the server , while using it we have to specify that we are using POST method like this</p>
<p> Example :</p>
<pre><code class="lang-bash"> curl -X POST https://api.myapp.com/users
</code></pre>
</li>
</ol>
<h2 id="heading-using-curl-to-talk-to-apis">Using cURL to talk to APIs</h2>
<p>For understanding the API request using cURL we are going to send the request to the github api and let see what type of response we are getting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769768722207/884b43ae-8652-4daf-9c47-f07bfd628d6b.png" alt class="image--center mx-auto" /></p>
<p>So, we have used <code>curl https://github.com/users/Shubh-ujala</code> and you can see we have got the JSON data which contains almost every information about my github account, this is how we can send the API request using cURL.</p>
<h2 id="heading-common-mistakes-with-curl">Common Mistakes with cURL</h2>
<ol>
<li><p><strong>Expecting a webpage UI</strong> →As a beginner we can expect some UI as a response but what we get a raw data as a response.</p>
</li>
<li><p>T<strong>hinking cURL replaces browse</strong>r → It doesn’t , it just tests communication , not user experience.</p>
</li>
<li><p><strong>Using too many flags too early →</strong> this leads to memoriztion , not understanding.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[The Process Behind DNS Resolution Explained]]></title><description><![CDATA[When we type url of the website on our browser, it doesn’t magically knows which server to hit or where is the webpage hosted , browser is like an computer which only understands the ip addresses , then how we are able to acces it by just writing nam...]]></description><link>https://www.shubhujalablogs.live/dns-resolution</link><guid isPermaLink="true">https://www.shubhujalablogs.live/dns-resolution</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[networking]]></category><category><![CDATA[dns]]></category><dc:creator><![CDATA[Shubh Ujala]]></dc:creator><pubDate>Fri, 30 Jan 2026 07:06:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769756521770/2f73131d-adf4-444d-9180-dcc552855202.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When we type url of the website on our browser, it doesn’t magically knows which server to hit or where is the webpage hosted , browser is like an computer which only understands the ip addresses , then how we are able to acces it by just writing names like <code>www.chaicode.com</code> ? here comes DNS.</p>
<ul>
<li>DNS acts as a phonebook of internet it translates the domain name into desired ip address. Once the browser gets the correct IP address from DNS, it can connect to the server and load the webpage</li>
</ul>
<h2 id="heading-why-name-resolution-exists">Why Name Resolution Exists?</h2>
<ul>
<li>Just Imagine a scenario , if you want to make a phone call with your friend then will you remeber his/her 10-digits phone number or save his/hername ? most probably you should go with name right? DNS solves the same problem without it we have to remember that long ip addresses , basically it converts ip addresses to human friendly names which are easy to remember, <mark>this conversion from name is called name resolution.</mark></li>
</ul>
<h2 id="heading-what-is-dig-command">What is <code>dig</code> command?</h2>
<p>Before Understanding how DNS works internally, we need a way or a tool to see how DNS works, that where <code>dig</code> command comes in.</p>
<p>What is <code>dig</code> ?</p>
<p>dig → <mark>Domain Information Groper</mark> is a DNS inspection tool that allows you to ask questions from DNS servers directly, inspects <a target="_blank" href="https://shubhujalablogs.live/dns-records">DNS records</a> and helps us to understand how DNS resolution works step by step</p>
<p>When <code>dig</code> is used?</p>
<p>dig is like an X-ray machine for DNS , it helps us while debugging DNS issues, learning how DNS works, verifying domain configurations and also while backend troubleshooting</p>
<h2 id="heading-understanding-dns-resolution-layers">Understanding DNS resolution layers</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769749840596/84bdedcb-c644-4bb8-b8b4-606373fbfc5a.png" alt class="image--center mx-auto" /></p>
<p>It works in following steps →</p>
<ol>
<li><p>Root Name Server : <code>dig . NS</code></p>
<pre><code class="lang-bash"> dig . NS
</code></pre>
<p> here <code>.</code> represents DNS root , basically you are asking “<em>who manages the top of DNS hirarchy?”</em></p>
<p> In response from the root server you will get response like : “<em>we don’t know every number but we know who manages</em> <code>.com</code> <em>,</em> <code>.org</code> <em>,</em><code>.in</code> <em>etc</em>.“</p>
<ul>
<li>Note → Root server don’t know IP address of the websites , it only know where TLD servers are</li>
</ul>
</li>
<li><p>TLD (Top-Level Domain) : <code>dig com NS</code></p>
<pre><code class="lang-bash"> dig com NS
</code></pre>
<p> here we are asking <em>who manages domain ending like</em> <code>.com</code> <em>?</em></p>
<p> In response we get like : <em>“we don’t know about</em> <code>google.com</code> <em>‘s IP but we know who is responsible form</em> <code>google.com</code> <em>“</em></p>
<ul>
<li>Note → TLD servers handles domain categories (<code>.com .org .net</code>), and also they points you to authoritative name servers, they don’t store actual website IPs</li>
</ul>
</li>
<li><p>Authoritative Name Servers :<code>dig google.com NS</code></p>
<pre><code class="lang-bash"> dig google.com NS
</code></pre>
<p> here we are asking “<em>who is the final authority for</em> <code>google.com</code><em>?”</em></p>
<p> In response we will get, these servers are manager by domain owner, store the real DNS records, Are the source of truth</p>
<ul>
<li>Note → NS (Name server) records tells us about, these servers are allowed for this domain , they enables control of the internet.</li>
</ul>
</li>
<li><p>Full DNS resolution : <code>dig google.com</code></p>
<pre><code class="lang-bash"> dig google.com
</code></pre>
<p> this shows us the final result i.e IP address.</p>
<p> Behind the scene it works like this</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769754942030/93c7affb-30a3-49f1-adb1-69120e4148c8.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p><strong>Importance of DNS for web developer →</strong></p>
<ul>
<li><p>it helps us to debug production issues, design scalable system</p>
</li>
<li><p>it also helps us to understand latency , configure domains properly</p>
</li>
</ul>
<p><strong>Importance of DNS in System design →</strong></p>
<ul>
<li><p>it is used in Load balancers , CDNs</p>
</li>
<li><p>it is also used in Microservices and</p>
</li>
</ul>
<h3 id="heading-conclusion">Conclusion :</h3>
<p>NS is the system that makes the internet usable for humans by converting easy-to-remember domain names into IP addresses that machines understand. Behind a single browser request lies a well-structured resolution process involving root, TLD, and authoritative name servers. By using tools like <code>dig</code>, we can observe this hidden flow and better understand how browsers find servers on the internet.</p>
<hr />
]]></content:encoded></item></channel></rss>