<?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: Darshan Kumar</title>
    <description>The latest articles on DEV Community by Darshan Kumar (@darshan_kumar_c9883cffc18).</description>
    <link>https://dev.to/darshan_kumar_c9883cffc18</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%2F1669599%2Fd2239030-a1ae-46da-ae14-ce83741261b7.jpg</url>
      <title>DEV Community: Darshan Kumar</title>
      <link>https://dev.to/darshan_kumar_c9883cffc18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/darshan_kumar_c9883cffc18"/>
    <language>en</language>
    <item>
      <title>Understanding Switch Case and Functions and What is Hoisting</title>
      <dc:creator>Darshan Kumar</dc:creator>
      <pubDate>Sun, 07 Jul 2024 06:09:14 +0000</pubDate>
      <link>https://dev.to/darshan_kumar_c9883cffc18/understanding-switch-case-and-functions-and-what-is-hoisting-5180</link>
      <guid>https://dev.to/darshan_kumar_c9883cffc18/understanding-switch-case-and-functions-and-what-is-hoisting-5180</guid>
      <description>&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Switch Case Statement in JavaScript
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
The switch case statement in JavaScript is used to execute one block of code among many options based on evaluating an expression. It is an alternative to using multiple if…else if statements and can make your code more readable and organized.&lt;/p&gt;

&lt;p&gt;switch (expression) { case value1: // Code to be executed if expression === value1 break; case value2: // Code to be executed if expression === value2 break; // Add more cases as needed default: // Code to be executed if the expression doesn’t match any case }&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Regular Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Regular functions in JavaScript are the most common way to define a function. They are determined using the function keyword followed by a name, a list of parameters enclosed in parentheses, and a block of code enclosed in curly braces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;function function-name(parameters) {&lt;/p&gt;

&lt;p&gt;// Code to be executed&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Function Expressions
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
A function expression is a function that is stored in a variable. Function expressions can be named or anonymous and are not hoisted, meaning they cannot be used before they are defined.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let variableName = function(parameters) {&lt;/p&gt;

&lt;p&gt;// Code to be executed&lt;/p&gt;

&lt;p&gt;};&lt;br&gt;
**&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrow Functions
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
**&lt;br&gt;
Arrow functions, introduced in ES6, provide a shorter syntax for writing function expressions. They do not have their own context and are often used for writing concise, anonymous functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;let variableName = (parameters) =&amp;gt; {&lt;/p&gt;

&lt;p&gt;// Code to be executed&lt;/p&gt;

&lt;p&gt;};&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Hoisting in JavaScript
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. This means you can use functions and variables before they are declared in the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Hoisting:&lt;/strong&gt; Function declarations are hoisted, so you can call a function before it is declared.&lt;/p&gt;

&lt;p&gt;console.log(greet()); // Output: Hello, world!&lt;/p&gt;

&lt;p&gt;function greet() {&lt;/p&gt;

&lt;p&gt;return “Hello, world!”;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable Hoisting:&lt;/strong&gt; Variable declarations (using var) are hoisted to the top of their scope but not their initializations. Variables declared with let and const are also hoisted but are not initialized until their definition is evaluated.&lt;/p&gt;

&lt;p&gt;Example with var:&lt;/p&gt;

&lt;p&gt;console.log(x); // Output: undefined&lt;/p&gt;

&lt;p&gt;var x = 5;&lt;/p&gt;

&lt;p&gt;console.log(x); // Output: 5&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Data Types of Typescript</title>
      <dc:creator>Darshan Kumar</dc:creator>
      <pubDate>Thu, 04 Jul 2024 07:02:58 +0000</pubDate>
      <link>https://dev.to/darshan_kumar_c9883cffc18/data-types-of-typescript-33de</link>
      <guid>https://dev.to/darshan_kumar_c9883cffc18/data-types-of-typescript-33de</guid>
      <description>&lt;p&gt;&lt;strong&gt;Boolean:&lt;/strong&gt; Represents a true or false value.&lt;br&gt;
Number: Represents both integer and floating-point numbers.&lt;br&gt;
&lt;strong&gt;String:&lt;/strong&gt; Represents a sequence of characters.&lt;br&gt;
&lt;strong&gt;Array:&lt;/strong&gt; Represents a collection of elements of the same type.&lt;br&gt;
&lt;strong&gt;Tuple:&lt;/strong&gt;  Represents an array with a fixed number of elements whose types are known.&lt;br&gt;
&lt;strong&gt;Enum:&lt;/strong&gt; Represents a group of named constant values.&lt;br&gt;
&lt;strong&gt;Any:&lt;/strong&gt; A type that allows any value. Useful when the type of a variable is unknown.&lt;br&gt;
&lt;strong&gt;Void:&lt;/strong&gt; Represents the absence of any type, commonly used as the return type of functions that do not return a value&lt;br&gt;
&lt;strong&gt;Null and Undefined:&lt;/strong&gt; Represents the absence of a value.&lt;br&gt;
&lt;strong&gt;Never:&lt;/strong&gt; Represents the type of values that never occur. Used as the return type for functions that always throw an error or never return.&lt;br&gt;
&lt;strong&gt;Object:&lt;/strong&gt; Represents a non-primitive type, i.e., anything that is not number, string, boolean, symbol, null, or undefined.&lt;br&gt;
&lt;strong&gt;Unknown:&lt;/strong&gt; Represents any value, similar to any, but safer because you can't perform operations on an unknown type without first asserting or narrowing it to a more specific type.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>typescript</category>
      <category>datatypes</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Difference Between TailwindCSS and Bootstrap</title>
      <dc:creator>Darshan Kumar</dc:creator>
      <pubDate>Tue, 02 Jul 2024 07:30:32 +0000</pubDate>
      <link>https://dev.to/darshan_kumar_c9883cffc18/difference-between-tailwindcss-and-bootstrap-2dei</link>
      <guid>https://dev.to/darshan_kumar_c9883cffc18/difference-between-tailwindcss-and-bootstrap-2dei</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Philosophy and Approach&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Bootstrap:&lt;/p&gt;

&lt;h2&gt;
  
  
  *&lt;em&gt;Component-Based: *&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Bootstrap provides pre-designed components like buttons, navbars, modals, and more. It aims to help developers quickly build responsive websites by using these ready-made components.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Opinionated Design:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Bootstrap comes with a specific design language and default styles, which can be customized but are opinionated out of the box.&lt;br&gt;
Utility Classes: Bootstrap includes utility classes but they are less extensive compared to Tailwind CSS.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS:
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Utility-First:
&lt;/h2&gt;

&lt;p&gt;Tailwind CSS is utility-first, providing low-level utility classes that can be combined to build custom designs. It emphasizes the composability and reusability of these utility classes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design Flexibility:
&lt;/h2&gt;

&lt;p&gt;Tailwind CSS offers more flexibility by allowing developers to style components directly within their HTML using utility classes, without having to override default styles.&lt;br&gt;
Customization: Tailwind CSS is highly customizable and can be configured to match any design system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ease of Use&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;## Bootstrap:&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Setup:
&lt;/h2&gt;

&lt;p&gt;Bootstrap is easier for beginners to get started with due to its extensive set of pre-designed components.&lt;br&gt;
&lt;strong&gt;Consistent Design:&lt;/strong&gt; Using Bootstrap's components ensures a consistent design across the application.&lt;br&gt;
Less Customization Needed: Bootstrap requires less customization and styling from the developer for standard designs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tailwind CSS:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Learning Curve:&lt;/strong&gt; Tailwind CSS might have a steeper learning curve for those unfamiliar with utility-first frameworks.&lt;br&gt;
&lt;strong&gt;Detailed Control:&lt;/strong&gt; It offers more detailed control over styles, allowing for unique and specific designs but requiring more effort in writing classes.&lt;br&gt;
&lt;strong&gt;Custom Classes:&lt;/strong&gt; Developers often need to write more HTML classes but have greater control over the final design.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;File Size and Performance&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Bootstrap:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Larger Initial Size: The compiled CSS file for Bootstrap can be relatively large because it includes styles for all components.&lt;br&gt;
Less Control: While you can customize Bootstrap, it might include unused CSS if you don’t modify the default build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS:
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Smaller Size with PurgeCSS: Tailwind CSS uses PurgeCSS to remove unused styles in production builds, resulting in smaller CSS files.&lt;br&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; This approach often leads to better performance in terms of file size and load times.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Community and Ecosystem
Bootstrap:
&lt;strong&gt;Mature Ecosystem:&lt;/strong&gt; Bootstrap has been around longer, with a large community and extensive documentation.
&lt;strong&gt;Wide Adoption:&lt;/strong&gt; It's widely adopted, and many third-party themes and components are available.
Tailwind CSS:
&lt;strong&gt;Growing Popularity: **Tailwind CSS is rapidly growing in popularity, with an increasing number of resources, plugins, and community contributions.
Modern Practices: Tailwind CSS aligns with modern development practices and is often used in conjunction with frameworks like React, Vue, and Next.js.
**5. Integration and Use Cases&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Bootstrap:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Quick Prototyping:&lt;/strong&gt; Ideal for quick prototyping and projects where you need a consistent design language with minimal effort.&lt;br&gt;
Corporate and Standardized Designs: Suitable for projects that benefit from a standardized look and feel.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  Tailwind CSS:
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Custom Designs:&lt;/strong&gt; Perfect for projects that require a custom design system and detailed control over the styling.&lt;br&gt;
Scalability: Better suited for applications where design needs to scale and adapt over time.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Choosing between Bootstrap and Tailwind CSS depends on your project requirements and your familiarity with the frameworks. If you need quick, standardized designs with ready-made components, Bootstrap might be the way to go. If you prefer more flexibility and control over your styles, and are willing to put in more effort upfront, Tailwind CSS could be a better fit.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Difference Between Javascript and TypeSript</title>
      <dc:creator>Darshan Kumar</dc:creator>
      <pubDate>Sun, 30 Jun 2024 06:45:03 +0000</pubDate>
      <link>https://dev.to/darshan_kumar_c9883cffc18/difference-between-javascript-and-typesript-4cka</link>
      <guid>https://dev.to/darshan_kumar_c9883cffc18/difference-between-javascript-and-typesript-4cka</guid>
      <description>&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Dynamic Typing: JavaScript is a dynamically typed language, meaning that variables can hold any value, and types are checked at runtime.&lt;br&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; The flexibility of JavaScript allows for rapid development and prototyping.&lt;br&gt;
&lt;strong&gt;Compatibility:&lt;/strong&gt; JavaScript is natively supported by all web browsers and is the standard language for web development.&lt;br&gt;
&lt;strong&gt;Ecosystem:&lt;/strong&gt; JavaScript has a vast ecosystem with numerous libraries and frameworks like React, Angular, and Vue.js.&lt;br&gt;
&lt;strong&gt;Popularity:&lt;/strong&gt; JavaScript is one of the most widely used programming languages in the world.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  TypeScript
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Static Typing:&lt;/strong&gt; TypeScript is a statically typed superset of JavaScript, meaning that it introduces type checking at compile time. This can help catch errors early in the development process.&lt;br&gt;
&lt;strong&gt;Type Annotations:&lt;/strong&gt; Developers can explicitly define types for variables, function parameters, and return values, making the code more readable and maintainable.&lt;br&gt;
&lt;strong&gt;Tooling:&lt;/strong&gt; TypeScript’s type system enables better tooling support, such as autocompletion, navigation, and refactoring in IDEs.&lt;br&gt;
&lt;strong&gt;Compile Step:&lt;/strong&gt; TypeScript code must be transpiled to JavaScript before running in a browser or Node.js environment.&lt;br&gt;
&lt;strong&gt;Adoption:&lt;/strong&gt; TypeScript is increasingly adopted in larger projects and by companies that value maintainable and scalable codebases.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
JavaScript is more flexible and doesn’t require type annotations, making it suitable for quick prototyping and smaller projects.&lt;br&gt;
TypeScript adds a layer of static typing and type safety, which can improve code quality and maintainability, especially in larger projects.&lt;br&gt;
In essence, TypeScript offers all the features of JavaScript but with additional capabilities that help write safer and more predictable code.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Methods of Array in Javascript</title>
      <dc:creator>Darshan Kumar</dc:creator>
      <pubDate>Fri, 28 Jun 2024 10:40:37 +0000</pubDate>
      <link>https://dev.to/darshan_kumar_c9883cffc18/methods-of-array-in-javascript-2g4j</link>
      <guid>https://dev.to/darshan_kumar_c9883cffc18/methods-of-array-in-javascript-2g4j</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4d4ubmcl03xygf2of3x9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4d4ubmcl03xygf2of3x9.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;push(): Adds one or more elements to the end of an array and returns the new length.&lt;br&gt;
pop(): Removes the last element from an array and returns that element.&lt;br&gt;
shift(): Removes the first element from an array and returns that element.&lt;br&gt;
unshift(): Adds one or more elements to the beginning of an array and returns the new length of the array.&lt;br&gt;
concat(): Returns a new array that combines two or more arrays.&lt;br&gt;
slice(): Returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included).&lt;br&gt;
splice(): Changes the contents of an array by removing or replacing existing elements and/or adding new elements&lt;br&gt;
filter(): Creates a new array with all elements that pass the test implemented by the provided function.&lt;br&gt;
join() : The join() method joins all elements of an array into a string.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>array</category>
      <category>frontend</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
