<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pancharas Shubham</title>
    <description>The latest articles on DEV Community by Pancharas Shubham (@pancharas_shubham_).</description>
    <link>https://dev.to/pancharas_shubham_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1531858%2F80a838d9-0a76-4179-9c0f-d46c8c503ebe.png</url>
      <title>DEV Community: Pancharas Shubham</title>
      <link>https://dev.to/pancharas_shubham_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pancharas_shubham_"/>
    <language>en</language>
    <item>
      <title>Basic JavaScript Through the Salaar Lens - Part 1</title>
      <dc:creator>Pancharas Shubham</dc:creator>
      <pubDate>Tue, 11 Mar 2025 21:03:25 +0000</pubDate>
      <link>https://dev.to/pancharas_shubham_/basic-javascript-through-the-salaar-lens-part-1-54ma</link>
      <guid>https://dev.to/pancharas_shubham_/basic-javascript-through-the-salaar-lens-part-1-54ma</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;JavaScript is one of the most powerful programming languages used for web development. But what if we could make learning JavaScript as thrilling as the world of Salaar? By drawing parallels between JavaScript concepts and the epic saga of Salaar, we can make learning more engaging and memorable. In this guide, we'll explore JavaScript through the lens of Salaar, comparing programming principles with warriors, clans, and battle strategies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("Welcome to JavaScript, the Salaar way!");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Story of var, let, and const in Salaar
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scope and Hoisting in the Kingdom of Khansaar
&lt;/h3&gt;

&lt;h4&gt;
  
  
  var – The Old Ruler of Khansaar
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;var is like the old ruling system of Khansaar—powerful but outdated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has function scope but no block scope, which can create unexpected results.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is hoisted but initialized with undefined.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(leader); // undefined (hoisted but not assigned)
var leader = "Old King of Khansaar";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  let – The Strategic War General
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;let is like Deva, the rising warrior who follows structured war strategies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has block scope, meaning it is only accessible within the block it is declared in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unlike var, it is hoisted but not initialized.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  let warPlan = "Attack at dawn";
  console.log(warPlan); // Accessible inside the block
}
console.log(warPlan); // Error: warPlan is not defined

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  const – The Unshakable Khansaar Throne
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;const represents the Supreme Leader—unchanging and absolute.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has block scope like let, but once assigned, its value cannot be changed.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const supremeLeader = "Khansaar King";
supremeLeader = "New King"; // Error: Cannot reassign a constant variable

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Best Practices / Important Notes
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Use console.table instead of console.log&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;accountId = 46
accountEmail = "rajmanar_ka_salaar@gmail.com"
accountPassword = "Maa@143"
accountCity = "Tinsukia"
accountState = "Assam"

console.table([accountId, accountEmail, accountPassword, accountCity, accountState])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Important Primitive Data Types
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
String (Represents text)
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let warrior = "Deva"; // Name of the warrior
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;br&gt;
Number (Represents numerical values)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let age = 35; // Deva's age
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;br&gt;
Boolean (Represents true/false values)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isKaaparWarrior = true; // Deva belongs to Kaapar clan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;/p&gt;

&lt;p&gt;Undefined (A variable that has been declared but not assigned a value)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let weapon;
console.log(weapon); // undefined (Deva's weapon is not assigned yet)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.&lt;br&gt;
Null (Represents an empty or unknown value)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let throne = null;             // Throne of Khansaar is currently empty
console.log((throne));         // null 
console.log(typeof(throne));   // object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.&lt;/p&gt;

&lt;p&gt;Symbol (Represents a unique value)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let uniqueID = Symbol("deva");
console.log(uniqueID); // Symbol(deva)
console.log(typeof(uniqueID)); // symbol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.&lt;/p&gt;

&lt;p&gt;BigInt (Used for very large numbers beyond the safe integer limit)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let kingdomWealth = BigInt(9876543210123456789);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Best Practices / Important Notes
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Type of Null Datatype is object. Refer to Null Datatype.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(typeof(throne));     // object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;"use strict"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine Khansaar had a chaotic rule earlier where warriors could take any weapon without permission (non-strict mode). Now, with Rajamannar disciplined leadership (strict mode), every action is monitored and mistakes are punished.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use strict";

warrior = "Deva"; // ❌ Error: warrior is not defined (undeclared variable)
console.log(warrior);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without "use strict", JavaScript would assume warrior is a global variable and run without error. But in strict mode, it prevents such mistakes, enforcing proper variable declarations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Types Conversions
&lt;/h2&gt;

&lt;p&gt;1.&lt;br&gt;
 String to Number&lt;/p&gt;

&lt;p&gt;Deva wants to convert his warrior rank (stored as a string) into a number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let rank = "1"; 
let numericRank = Number(rank);  
console.log(numericRank); // Output: 1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;br&gt;
 Number to String&lt;/p&gt;

&lt;p&gt;Vardha wants to convert his power level into a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let powerLevel = 9000;
let powerStr = String(powerLevel);
console.log(powerStr); // Output: "9000"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;br&gt;
 Boolean to Number&lt;/p&gt;

&lt;p&gt;A warrior’s loyalty (true or false) is converted into a number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isLoyal = true;
let loyalNumber = Number(isLoyal);
console.log(loyalNumber); // Output: 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;br&gt;
 Number to Boolean&lt;/p&gt;

&lt;p&gt;If an army size is 0, it means no warriors. Any non-zero value means they exist.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let armySize = 100;
let hasArmy = Boolean(armySize);
console.log(hasArmy); // Output: true

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.&lt;br&gt;
 String to Boolean&lt;/p&gt;

&lt;p&gt;A non-empty string means a warrior exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let warriorName = "Deva";
console.log(Boolean(warriorName)); // Output: true

let emptyName = "";
console.log(Boolean(emptyName)); // Output: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>datatype</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is a web server ?</title>
      <dc:creator>Pancharas Shubham</dc:creator>
      <pubDate>Sun, 08 Sep 2024 19:53:45 +0000</pubDate>
      <link>https://dev.to/pancharas_shubham_/what-is-a-web-server--5hf0</link>
      <guid>https://dev.to/pancharas_shubham_/what-is-a-web-server--5hf0</guid>
      <description>&lt;h1&gt;
  
  
  Web server refers to both hardware and software.
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;A web server is not like a supercomputer or any other large machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;** Basically web server is another computer that acts as a host to store webpage files and software. **&lt;/p&gt;

&lt;p&gt;A web server is like a special computer that stores all the parts of a website, like the text, images, and styles. It connects to the Internet so people can visit the website from their own devices.&lt;/p&gt;

&lt;p&gt;The web server also has software that knows how to handle requests when someone types a web address (URL) in their browser. It understands these requests and sends back the right content from the website to the person’s device so they can see the webpage.&lt;/p&gt;

&lt;p&gt;A web server is a computer that helps people visit websites. It has special software called an HTTP server that understands website addresses (URLs) and uses a language called HTTP to show pages in your browser. When you type a website's address, the server sends the right pages to your device so you can see them.&lt;/p&gt;

&lt;p&gt;When your browser asks for a file from a web server, it sends a request using HTTP. The server then finds the file and sends it back to your browser so you can view it. If the file isn't there, the server tells you with a “404 error,” which means the page can’t be found.&lt;/p&gt;

</description>
      <category>webserver</category>
      <category>apache2</category>
      <category>nginx</category>
      <category>internet</category>
    </item>
  </channel>
</rss>
