<?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: Raj</title>
    <description>The latest articles on DEV Community by Raj (@rajasekar1998).</description>
    <link>https://dev.to/rajasekar1998</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4022101%2Fb0a65021-21e6-44d1-b6e6-e21d94e1d37a.jpg</url>
      <title>DEV Community: Raj</title>
      <link>https://dev.to/rajasekar1998</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajasekar1998"/>
    <language>en</language>
    <item>
      <title>Java</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Fri, 30 Oct 2026 06:35:24 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/java-42o0</link>
      <guid>https://dev.to/rajasekar1998/java-42o0</guid>
      <description>&lt;p&gt;&lt;strong&gt;what is java?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java is a high level programming language for building web ,desktop,mobile and enteriprise applications.java is platform independenat because it runs on the java virtual machine(jvm).java supports object oriented programming concepts link classes ,object,inheritance and polymorphism.secure and robust with strong memory management &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;core components&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JDK java development kit contains the tools libraries and compiler needed to applications&lt;/li&gt;
&lt;li&gt;JRM java runtime evironment provides the libreries and the jvm required to run compiled java programs&lt;/li&gt;
&lt;li&gt;JVM java virtual machine translates bytecode into native machine instructions for the underlying operating system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;types of data types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;java define data a varible can hold and memory required to store it they are broadly divided into two categories&lt;/p&gt;

&lt;p&gt;1.Primitive Data type Store simple values directly in memory.&lt;/p&gt;

&lt;p&gt;2.Non Primitive (Reference) Data types Store memory references to objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Primitive Dta types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Primitive data types are the basic built-in data types in Java. They are used to store simple values such as numbers, characters, and true or false values.Java has 8 primitive data types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. byte&lt;/strong&gt;&lt;br&gt;
The byte data type is used to store small integer values. It takes 1 byte of memory(Range: -128 to 127).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. short&lt;/strong&gt;&lt;br&gt;
The short data type is used to store integer values that are larger than byte. It takes 2 bytes of memory(Range: -32,768 to 32,767).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. int&lt;/strong&gt;&lt;br&gt;
The int data type is used to store whole numbers. It is commonly used for storing integer values. It takes 4 bytes of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. long&lt;/strong&gt;&lt;br&gt;
The long data type is used to store very large whole numbers. It takes 8 bytes of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. float&lt;/strong&gt;&lt;br&gt;
The float data type is used to store decimal numbers. It takes 4 bytes of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. double&lt;/strong&gt;&lt;br&gt;
The double data type is used to store decimal numbers with more precision than float. It takes 8 bytes of memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. char&lt;/strong&gt;&lt;br&gt;
The char data type is used to store a single character. It takes 2 bytes of memory in Java.&lt;br&gt;
**&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;boolean**
The boolean data type is used to store only two values: true or false.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*&lt;em&gt;Non-Primitive (Reference) Data Types *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Non-primitive data types, also called Reference Data Types, are used to store and work with more complex data in Java.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. String&lt;/strong&gt;&lt;br&gt;
String is used to store a sequence of characters (text). We use double quotes to create a String.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Array&lt;/strong&gt;&lt;br&gt;
An Array is used to store multiple values of the same data type in a single variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Class&lt;/strong&gt;&lt;br&gt;
A Class is a blueprint for creating objects. It defines variables and methods that describe the properties and behaviours of objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Object&lt;/strong&gt;&lt;br&gt;
An Object is an instance of a class. It represents a real-world entity and contains data and behaviour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Interface&lt;/strong&gt;&lt;br&gt;
An Interface is used to define a contract that classes can implement. It contains method declarations that implementing classes provide with their own implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Enum&lt;/strong&gt;&lt;br&gt;
Enum (Enumeration) is used to define a fixed set of constants.&lt;/p&gt;

</description>
      <category>java</category>
      <category>basic</category>
    </item>
    <item>
      <title>Python</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Thu, 29 Oct 2026 19:07:45 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/python-5dio</link>
      <guid>https://dev.to/rajasekar1998/python-5dio</guid>
      <description>&lt;p&gt;&lt;strong&gt;what is python&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Python is a popular programming language.also python is a interpreted,object,higeh level programming language.platform lndependent programs can run on different operating systems.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;why using python *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;python is widely used across industries.it web development,data science,machine learning ,automation ,analyze data .it many libraries and frameworks that make development easier .&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;advantages *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;1.it balance ease of use with immense structural power.&lt;/p&gt;

&lt;p&gt;2.less code we can write programs with fewer lines of code.&lt;/p&gt;

&lt;p&gt;3.extensive suppoert libraries link numpy for numerical  calculations and pands for data analytics making it suitable scientific and data relatd applications&lt;/p&gt;

&lt;p&gt;4.Dynamically typed language meaning you don t need to declare data types explicitly making it flexible but still relible&lt;/p&gt;

&lt;p&gt;5.object oriented and procedural programming language python supports both object oriented and procedural programming providing versatility in code styles&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Disadvantages *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;performance python is generally slower than compiled languages link c,c++,and java which can affect performance intensive tasks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.memory consumption python can use more memory when handling large datasets because its data structures and runtime require additional memory&lt;/p&gt;

&lt;p&gt;3.Dynamic typing python determines variable types runtime which can make some errors harder to detect before execution and may lead bugs.&lt;/p&gt;

&lt;p&gt;4.packaging and versiong python libraries may different version requirements causing dependency conflicts and making project setup and deployment more difficult.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>hook useState</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Thu, 22 Oct 2026 18:29:50 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/hook-usestate-3hi3</link>
      <guid>https://dev.to/rajasekar1998/hook-usestate-3hi3</guid>
      <description>&lt;p&gt;Why Do We Use useState in React?&lt;/p&gt;

&lt;p&gt;When I started learning React I wanted to understand why we use useState instead of a normal JavaScript variable.&lt;br&gt;
In JavaScript we can create a variable and change its value using a function. But changing a variable does not automatically update the value displayed on the HTML page.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;If we create a counter using a normal variable the value can increase when we click a button but the screen will not update automatically.&lt;br&gt;
In React we use the useState hook to solve this problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Does useState Work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First we need to import useState from React.&lt;/p&gt;

&lt;p&gt;import{ useState } from "react";&lt;/p&gt;

&lt;p&gt;Then we can create a state variable.&lt;/p&gt;

&lt;p&gt;const [count,setCount] = useState(0);&lt;/p&gt;

&lt;p&gt;Here count stores the current value and setCount is used to update that value. The initial value is 0.&lt;/p&gt;

&lt;p&gt;When we click a button we can increase the value like this:&lt;/p&gt;

&lt;p&gt;function add () {&lt;br&gt;
setCount (count + 1);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Whenever we call setCount React updates the state and renders the component again to display the new value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Is useState Important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We use useState when we want the screen to change according to the data. For example we can use it to create counters store input values show or hide menus and display data received from an API.&lt;/p&gt;

&lt;p&gt;A normal JavaScript variable can also be used to change data but React does not automatically re-render the component just because that variable changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;useState is an important React hook because it helps us manage changing data and update the user interface. Understanding how it works makes it easier to build interactive React applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>usestate</category>
      <category>hook</category>
    </item>
    <item>
      <title>Error in java</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Thu, 22 Oct 2026 16:44:03 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/error-in-java-2j5h</link>
      <guid>https://dev.to/rajasekar1998/error-in-java-2j5h</guid>
      <description>&lt;p&gt;Common Mistakes and Errors in Java&lt;/p&gt;

&lt;p&gt;When we write a Java program we may make small mistakes. Even a small mistake can cause an error in our program. Sometimes the program will not compile and sometimes it will not run properly.&lt;/p&gt;

&lt;p&gt;my Home class program I may make the following mistakes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing Semicolon (;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I forget to put a semicolon at the end of System.out.println("Hello World"); Java will show a compilation error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing Dot (.)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I forget the dot in System.out.println() Java will not understand the statement correctly and may show a compilation error.&lt;/p&gt;

&lt;p&gt;** Missing Curly Brackets { }**&lt;/p&gt;

&lt;p&gt;If I forget the opening or closing curly bracket Java may show an error because the code block is incomplete.&lt;br&gt;
**&lt;br&gt;
 Missing Parentheses ( )**&lt;/p&gt;

&lt;p&gt;If I forget the parentheses in the main method or print statement Java may show a compilation error.&lt;br&gt;
**&lt;br&gt;
 Missing public**&lt;/p&gt;

&lt;p&gt;If I remove public from the main method the program may compile but Java may not be able to access the main method to start the program.&lt;/p&gt;

&lt;p&gt;** Missing static**&lt;/p&gt;

&lt;p&gt;If I remove static from the main method the program may compile but Java may not recognize it as the correct entry &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing void&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I remove void from the main method without replacing it with a valid return type the program will show a compilation &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing  main&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write the main method name incorrectly Java may not find the main method and may show a main-method error when I run the program.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect String Spelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write string instead of String Java will show an error because Java is case-sensitive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect System Spelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write system instead of System Java will show a compilation error because uppercase and lowercase letters are different in Java.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect println Spelling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write  Println instead of println Java may show a compilation error because the method &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing Double Quotes (" ")single Quotes (' ')&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I forget the double quotes around Hello World Java may show a compilation error because the text is not written corr&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect Class  Name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write the class name incorrectly I may get a compilation error or a class not found error when I run the program. If the class is declared public the filename must mat&lt;/p&gt;

&lt;p&gt;** Missing Class **&lt;/p&gt;

&lt;p&gt;If I forget to write class before the class name Java will show a &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extra Semicolon&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I put an extra semicolon in the wrong place the program may compile but behave differently from what I expected. The result depends&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect  Capital Letters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java is case-sensitive  Home, home, and HOME are different names. Using the wrong capitalization &lt;/p&gt;

&lt;p&gt;Missing Closing Bracket at the EndBracket at the End**&lt;/p&gt;

&lt;p&gt;If I forget the final closing curly bracket Java may show an error because the class or method &lt;/p&gt;

&lt;p&gt;** Writing Code Outside the Class Outside the Class**&lt;/p&gt;

&lt;p&gt;If I write a statement such as System.out.println() directly outside a method Java may show &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing the Print Statement Incorrectly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write System.out.println without the correct parentheses or semicolon Java may show &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incorrect File Name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the public class is named Home the source file should be named Home.java.  Java may show a filename related compilation error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Method  Mistake&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I change String[] args incorrectly or write the main method with an invalid declaration Java may not recognize the main method as the program entry point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing the Main Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If I write the class and print statement but forget the main method Java will not find the correct starting point when I try to run the program.&lt;/p&gt;

</description>
      <category>java</category>
    </item>
    <item>
      <title>closure</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Tue, 06 Oct 2026 05:54:56 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/closure-30h5</link>
      <guid>https://dev.to/rajasekar1998/closure-30h5</guid>
      <description>&lt;p&gt;when learned about closure,it felt a little confusing .but once we understand&lt;/p&gt;

&lt;p&gt;a closure happens when an inner function remembers and uses variable from its outer function even after the outer function has finished&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;function outer() {&lt;br&gt;
   let name = "raj";&lt;br&gt;
 function inner (){&lt;br&gt;
  console.log(name);&lt;br&gt;
}&lt;br&gt;
  return inner ;&lt;br&gt;
}&lt;br&gt;
 let result = outer();&lt;br&gt;
    result();&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; //raj
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8t36az2nra57cx1f8yh.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8t36az2nra57cx1f8yh.jpeg" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;why can result () still access name?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;because the inner() function remember the name variable from outer().that memory is called closure.&lt;/p&gt;

&lt;p&gt;easy is remebered betwwen each fuction call.&lt;br&gt;
colsure  a function that remebers the variables from its outer scope&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Callback Function</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Fri, 25 Sep 2026 12:57:31 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/callback-function-3aj1</link>
      <guid>https://dev.to/rajasekar1998/callback-function-3aj1</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is a Callback Function?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A callback function is a function that we pass as an argument to another function so that the receiving function can call it when it needs to.&lt;br&gt;
In other words one function can receive another function and decide when that function should be executed.&lt;/p&gt;

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

&lt;p&gt;function greet() {&lt;br&gt;
  console.log("hello"):&lt;br&gt;
}   &lt;/p&gt;

&lt;p&gt;function welcome(callback) {&lt;br&gt;
  callback();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;welcome(greet);&lt;/p&gt;

&lt;p&gt;Here "greet" is passed to "welcome()" as an argument.&lt;/p&gt;

&lt;p&gt;welcome(greet);&lt;/p&gt;

&lt;p&gt;Inside the "welcome()" function we receive it through the "callback" parameter:&lt;/p&gt;

&lt;p&gt;function welcome(callback) {&lt;br&gt;
    callback();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;When we write:&lt;/p&gt;

&lt;p&gt;callback();&lt;/p&gt;

&lt;p&gt;JavaScript executes the "greet()" function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyiiqyo1b7qtbwr1lr9zu.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyiiqyo1b7qtbwr1lr9zu.jpeg" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do We Use Callback Functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main reason we use a callback is that we don't always want to decide inside a function what should happen next.&lt;/p&gt;

&lt;p&gt;Instead, we can give the function another function and say:&lt;/p&gt;

&lt;p&gt;After you finish your work call this function.&lt;/p&gt;

&lt;p&gt;For example one function can perform some work and after that work is completed it can call the function that was passed to it.&lt;br&gt;
This makes the code more flexible because we can change the function we pass as the callback without changing the main function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Happens When We Pass an Argument?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we do:&lt;/p&gt;

&lt;p&gt;welcome(greet);&lt;/p&gt;

&lt;p&gt;the "greet" function is passed into the "callback" parameter.&lt;/p&gt;

&lt;p&gt;So we can think of it like this:&lt;/p&gt;

&lt;p&gt;welcome(greet)&lt;br&gt;
       ↓&lt;br&gt;
callback = greet&lt;br&gt;
       ↓&lt;br&gt;
callback()&lt;br&gt;
       ↓&lt;br&gt;
greet()&lt;/p&gt;

&lt;p&gt;Finally "greet()" gets executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Happens If We Don't Pass the Callback?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the function expects a callback:&lt;/p&gt;

&lt;p&gt;function welcome(callback) {&lt;br&gt;
    callback();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;but we call it like this:&lt;/p&gt;

&lt;p&gt;welcome();&lt;/p&gt;

&lt;p&gt;then there is no function inside "callback".&lt;/p&gt;

&lt;p&gt;So when JavaScript reaches:&lt;/p&gt;

&lt;p&gt;callback();&lt;/p&gt;

&lt;p&gt;it cannot execute it because "callback" is "undefined".&lt;/p&gt;

&lt;p&gt;That results in an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What About 2, 3, 4 or 5 Functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The number of functions does not decide whether an argument is required.&lt;br&gt;
Even with just two functions if one function is passed to another function we use an argument:&lt;/p&gt;

&lt;p&gt;function greet() {&lt;br&gt;
    console.log("Hello");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function welcome(callback) {&lt;br&gt;
    callback();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;welcome(greet);&lt;/p&gt;

&lt;p&gt;Here "greet" is the callback and it is passed as an argument.&lt;br&gt;
The same idea can continue with 3, 4, 5, or more functions.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/..." class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/..." alt="Uploading image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Function 1&lt;br&gt;
    ↓&lt;br&gt;
passes Function 2&lt;br&gt;
    ↓&lt;br&gt;
Function 2&lt;br&gt;
    ↓&lt;br&gt;
passes Function 3&lt;br&gt;
    ↓&lt;br&gt;
Function 3&lt;br&gt;
    ↓&lt;br&gt;
passes Function 4&lt;br&gt;
    ↓&lt;br&gt;
Function 4&lt;/p&gt;

&lt;p&gt;In this kind of chain, each function that needs to receive the next function has to receive it somehow — commonly as an argument.&lt;/p&gt;

&lt;p&gt;So the important rule is not:&lt;/p&gt;

&lt;p&gt;"More functions = callback argument."&lt;/p&gt;

&lt;p&gt;The actual rule is:&lt;/p&gt;

&lt;p&gt;When one function is passed into another function the passed function is the callback.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What is React</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Thu, 24 Sep 2026 14:12:43 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/what-is-react-39nm</link>
      <guid>https://dev.to/rajasekar1998/what-is-react-39nm</guid>
      <description>&lt;p&gt;&lt;strong&gt;Bootstrap vs React: What’s the Difference?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I first learned about Bootstrap and React I thought they were almost the same because both of them are called libraries. But actually they are used for different purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is a Library?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A library is basically a collection of code that is already written by someone else and made available for us to use.&lt;br&gt;
Instead of writing everything from the beginning we can use the code provided by the library in our own project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap already has styles for buttons, cards, forms, navigation bars and many other UI elements. So we don't have to create all those styles ourselves.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Bootstrap?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap is mainly a CSS and UI library.&lt;/p&gt;

&lt;p&gt;We normally create our webpage using HTML and then use Bootstrap classes to make the page look better and responsive.&lt;/p&gt;

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

&lt;p&gt;Click Me&lt;/p&gt;

&lt;p&gt;"btn" and "btn-primary" are Bootstrap classes.&lt;/p&gt;

&lt;p&gt;Bootstrap already provides the styling for these classes so we don't need to write all the CSS for this button ourselves.&lt;br&gt;
Bootstrap mainly helps us with the design and styling of a website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is React?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React is a JavaScript library for building user interfaces.&lt;br&gt;
React is different from Bootstrap because React is not mainly used for styling.&lt;br&gt;
React helps us build the UI using reusable components.&lt;/p&gt;

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

&lt;p&gt;function Welcome() {&lt;br&gt;
  return &lt;/p&gt;
&lt;h1&gt;Hello World&lt;/h1&gt;;&lt;br&gt;
}

&lt;p&gt;At first "&lt;/p&gt;
&lt;h1&gt;" looks like normal HTML But inside React we use a syntax called JSX.&lt;br&gt;
JSX looks similar to HTML but it works with JavaScript and React.&lt;br&gt;
This makes it easier to create and manage different parts of a web application as reusable components.&lt;/h1&gt;


&lt;p&gt;&lt;strong&gt;why React use HTML and CSS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When working with React we still use things that we already know from web development such as HTML like JSX and CSS.&lt;/p&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;p&gt;function Button() {&lt;br&gt;
  return (&lt;br&gt;
    &lt;br&gt;
      Click Me&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Then we can write CSS for that button:&lt;/p&gt;

&lt;p&gt;.my-button {&lt;br&gt;
  background: blue;&lt;br&gt;
  color: white;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;So React does not mean that we stop using HTML and CSS.&lt;/p&gt;

&lt;p&gt;Instead React gives us a different way to build the UI using JavaScript, JSX and reusable components.&lt;/p&gt;



</description>
    </item>
    <item>
      <title>JavaScript Function</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Fri, 11 Sep 2026 05:16:44 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/javascript-function-12gm</link>
      <guid>https://dev.to/rajasekar1998/javascript-function-12gm</guid>
      <description>&lt;p&gt;A function is a block of code that we create to perform a particular task.&lt;/p&gt;

&lt;p&gt;Instead of writing the same code again and again we can write it once inside a function and call the function whenever we need it.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;javascript&lt;br&gt;
function greet() {&lt;br&gt;
    console.log("Hello Raj");&lt;br&gt;
}&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;How it works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxnuny2slxqt1nqv06z77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxnuny2slxqt1nqv06z77.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;function greet()&lt;br&gt;
       ↓&lt;br&gt;
Function is created&lt;br&gt;
       ↓&lt;br&gt;
Code is written inside {}&lt;br&gt;
       ↓&lt;br&gt;
greet()&lt;br&gt;
       ↓&lt;br&gt;
Function is called&lt;br&gt;
       ↓&lt;br&gt;
"Hello Raj" is printed&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do we use functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Functions help us to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse code&lt;/li&gt;
&lt;li&gt;Avoid writing the same code again&lt;/li&gt;
&lt;li&gt;Keep code clean and organized&lt;/li&gt;
&lt;li&gt;Make programs easier to understand&lt;/li&gt;
&lt;li&gt;Perform a specific task whenever needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Function with Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can also send information to a function.&lt;/p&gt;

&lt;p&gt;javascript&lt;br&gt;
function greet(name) {&lt;br&gt;
    console.log("Hello " + name);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;greet("Raj");&lt;br&gt;
greet("Kumar");&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;Hello Raj&lt;br&gt;
Hello Kumar&lt;/p&gt;

&lt;p&gt;Here&lt;code&gt;name&lt;/code&gt; is called a parameter.&lt;/p&gt;

&lt;p&gt;The value &lt;code&gt;"Raj"&lt;/code&gt; is called an argument.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixnrc2y39uskxieav947.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fixnrc2y39uskxieav947.png" alt=" " width="800" height="731"&gt;&lt;/a&gt;&lt;br&gt;
**&lt;br&gt;
Function with Return**&lt;/p&gt;

&lt;p&gt;A function can also return a value.&lt;/p&gt;

&lt;p&gt;javascript&lt;br&gt;
function add(a, b) {&lt;br&gt;
    return a + b;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let result = add(10, 20);&lt;/p&gt;

&lt;p&gt;console.log(result);&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;30&lt;/p&gt;

&lt;p&gt;Here &lt;code&gt;return&lt;/code&gt; sends the result back from the function.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>CSS :root Selector</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Tue, 08 Sep 2026 05:25:46 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/css-root-selector-386</link>
      <guid>https://dev.to/rajasekar1998/css-root-selector-386</guid>
      <description>&lt;p&gt;What is :root?&lt;br&gt;
:root in CSS. At first I was confused about why we use :root instead of simply writing CSS normally.&lt;/p&gt;

&lt;p&gt;In :root represents the main  element of a webpage. It is commonly used to store CSS variables that we want to use throughout our website.&lt;/p&gt;

&lt;p&gt;Why do we use :root?&lt;/p&gt;

&lt;p&gt;The main reason is to keep our commonly used values in one place.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;instead of writing the same colors again and again, we can create a variable:&lt;/p&gt;

&lt;p&gt;:root {&lt;br&gt;
    --bg-main: #ffffff;&lt;br&gt;
    --text-main: #1a1a1a;&lt;br&gt;
    --accent: #6200ee;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Then we can use those variables anywhere in our CSS:&lt;/p&gt;

&lt;p&gt;body {&lt;br&gt;
    background-color: var(--bg-main);&lt;br&gt;
    color: var(--text-main);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;button {&lt;br&gt;
    background-color: var(--accent);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;How does it work?&lt;/p&gt;

&lt;p&gt;The :root section stores the values.&lt;/p&gt;

&lt;p&gt;The --bg-main, --text-main and --accent names are CSS variables.&lt;/p&gt;

&lt;p&gt;When we use var(--accent), CSS takes the value stored inside --accent.&lt;/p&gt;

&lt;p&gt;So the basic flow is:&lt;/p&gt;

&lt;p&gt;:root → Store values → var() → Use values&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;This becomes especially useful when creating a website with different color.&lt;/p&gt;

&lt;p&gt;For example, we can have one set of variables for a colors and another set for a colors.&lt;/p&gt;

&lt;p&gt;:root {&lt;br&gt;
    --bg-main: white;&lt;br&gt;
    --text-main: black;&lt;br&gt;
    --accent: purple;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Later we can change these values for a colors.&lt;/p&gt;

&lt;p&gt;This makes our CSS easier to manage because we don't have to change every element individually.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript vs TypeScript What’s the Difference?</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Wed, 02 Sep 2026 05:58:42 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/javascript-vs-typescript-whats-the-difference-3eop</link>
      <guid>https://dev.to/rajasekar1998/javascript-vs-typescript-whats-the-difference-3eop</guid>
      <description>&lt;p&gt;JavaScript and TypeScript are both widely used in web development and they are closely related. The main difference is how they handle data types and errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is JavaScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is a dynamically typed programming language. We don't need to specify the type of a variable when declaring it. JavaScript is flexible and can run directly in web browsers, which makes it popular for building interactive websites and web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is TypeScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TypeScript is a superset of JavaScript developed by Microsoft. It adds static typing, which allows developers to specify whether a variable should be a number, string, boolean, or another type. This helps developers find errors earlier while writing the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qb1jxagm8bioe3wc7kz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0qb1jxagm8bioe3wc7kz.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;example in JavaScript:&lt;/p&gt;

&lt;p&gt;let age = 25;&lt;br&gt;
age = "vijay";&lt;/p&gt;

&lt;p&gt;This is allowed because JavaScript is flexible with variable types.&lt;/p&gt;

&lt;p&gt;In TypeScript:&lt;/p&gt;

&lt;p&gt;let age: number = 25;&lt;br&gt;
age = "vijay"; // Error&lt;/p&gt;

&lt;p&gt;Here, TypeScript gives an error because age is defined as a number.&lt;/p&gt;

&lt;p&gt;Another important difference is that JavaScript can run directly in the browser, while TypeScript needs to be converted into JavaScript before it can run.&lt;/p&gt;

&lt;p&gt;In simple terms, JavaScript provides flexibility while TypeScript adds more structure and type safety. JavaScript is often a good starting point for beginners while TypeScript is especially useful for larger and more complex applications where maintaining clean and reliable code is important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do Developers Use TypeScript?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One major reason developers use TypeScript is to reduce mistakes in large applications.&lt;/p&gt;

&lt;p&gt;Imagine a project has thousands of lines of code and many developers are working on it. Without clear information about what type of data a function expects it can become difficult to understand and maintain the code.&lt;/p&gt;

&lt;p&gt;TypeScript can make the code easier to understand by clearly defining the expected types.&lt;/p&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;p&gt;function add(a: number, b: number): number {&lt;br&gt;
    return a + b;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Here we can immediately understand that:&lt;/p&gt;

&lt;p&gt;a should be a number.&lt;br&gt;
b should be a number.&lt;br&gt;
The function returns a number.&lt;/p&gt;

&lt;p&gt;This can make large projects easier to maintain.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why do we Convert String to Number and Number to String in a Calculator?</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Fri, 28 Aug 2026 04:52:01 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/why-do-we-convert-string-to-number-and-number-to-string-in-a-calculator-l88</link>
      <guid>https://dev.to/rajasekar1998/why-do-we-convert-string-to-number-and-number-to-string-in-a-calculator-l88</guid>
      <description>&lt;p&gt;In calculator we use:&lt;/p&gt;

&lt;p&gt;const input = document.getElementById("display");&lt;/p&gt;

&lt;p&gt;Here display is the input element where the calculator values are shown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Why do we use String for user input?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the user clicks number buttons we need to join the digits together.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;currentValue += value;&lt;/p&gt;

&lt;p&gt;If the user clicks:&lt;/p&gt;

&lt;p&gt;5 → 0&lt;/p&gt;

&lt;p&gt;We need:&lt;/p&gt;

&lt;p&gt;"5" + "0" = "50"&lt;/p&gt;

&lt;p&gt;So, we keep the entered value as a String.&lt;/p&gt;

&lt;p&gt;This makes it easy to enter multiple digits like:&lt;/p&gt;

&lt;p&gt;5 → 0 → 2&lt;/p&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;p&gt;"502"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Why do we convert String to Number?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we perform a calculation JavaScript must treat the values as numbers.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;"50" + "2"&lt;/p&gt;

&lt;p&gt;Since both are Strings JavaScript joins them together:&lt;/p&gt;

&lt;p&gt;"502" &lt;/p&gt;

&lt;p&gt;But we actually want:&lt;/p&gt;

&lt;p&gt;50 + 2 = 52 &lt;/p&gt;

&lt;p&gt;Therefore before calculation we convert the String into a Number:&lt;/p&gt;

&lt;p&gt;const leftOperand = Number(previousValue);&lt;br&gt;
const rightOperand = Number(currentValue);&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;Number("50") → 50&lt;br&gt;
Number("2")  → 2&lt;/p&gt;

&lt;p&gt;So JavaScript can perform the actual mathematical calculation:&lt;/p&gt;

&lt;p&gt;50 + 2 = 52&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Why do we convert Number back to String?
**&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After calculation the result is a Number.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;currentValue = leftOperand + rightOperand;&lt;/p&gt;

&lt;p&gt;The result is:&lt;/p&gt;

&lt;p&gt;52&lt;/p&gt;

&lt;p&gt;This is a Number.&lt;/p&gt;

&lt;p&gt;We convert it back to String using:&lt;/p&gt;

&lt;p&gt;currentValue = currentValue.toString();&lt;/p&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;p&gt;52 → "52"&lt;/p&gt;

&lt;p&gt;We do this because our &lt;code&gt;currentValue&lt;/code&gt; is used again for handling the calculator's displayed/input value.&lt;/p&gt;

&lt;p&gt;Simple Flow&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fovsz481mojc88h056pxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fovsz481mojc88h056pxb.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We use String while entering digits convert String to Number when performing calculations and convert the result back to String so it can continue to be handled as the calculator's input/display value.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Control Flow Statements</title>
      <dc:creator>Raj</dc:creator>
      <pubDate>Thu, 27 Aug 2026 04:23:34 +0000</pubDate>
      <link>https://dev.to/rajasekar1998/javascript-control-flow-statements-43cd</link>
      <guid>https://dev.to/rajasekar1998/javascript-control-flow-statements-43cd</guid>
      <description>&lt;p&gt;Control flow statements in JavaScript control the order in which code is executed. These statements allow you to make decisions, repeat tasks, and jump between parts of a program based on specific conditions.&lt;br&gt;
&lt;strong&gt;JavaScript if Statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The if statement executes a block of code only if a specified condition is true.&lt;br&gt;
if_statement&lt;/p&gt;

&lt;p&gt;const age = 18;&lt;/p&gt;

&lt;p&gt;if (age &amp;gt;= 18) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("You are an adult.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checks if age is greater than or equal to 18.
Logs "You are an adult." if the condition is true.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript if...else Statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The if...else statement provides an alternate block of code to execute if the condition is false.&lt;br&gt;
if_else_statement&lt;/p&gt;

&lt;p&gt;const score = 40;&lt;/p&gt;

&lt;p&gt;if (score &amp;gt;= 50) {&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;} else {&lt;/p&gt;

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

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;It will log "You passed." if the score is 50 or more.
Otherwise, logs "You failed."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript if...else if...else Statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The if...else if...else statement is used when you want to handle multiple conditions.&lt;br&gt;
if_else_if_else_statement&lt;/p&gt;

&lt;p&gt;const temp = 25;&lt;/p&gt;

&lt;p&gt;if (temp &amp;gt; 30) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("It's hot.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} else if (temp &amp;gt;= 20) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("It's warm.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} else {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("It's cold.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checks if the temperature is greater than 30, logs "It's hot."
If not, checks if it's between 20 and 30, logs "It's warm."
Otherwise, logs "It's cold."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Switch Statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The switch statement evaluates an expression and executes a block of code based on matching cases. It provides an alternative to long if-else chain.&lt;br&gt;
switch_statement&lt;/p&gt;

&lt;p&gt;const day = "Monday";&lt;/p&gt;

&lt;p&gt;switch (day) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case "Monday":

    console.log("Start of the week.");

    break;

case "Friday":

    console.log("End of the workweek.");

    break;

default:

    console.log("It's a regular day.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checks the value of day and matches it to a case.
Logs "Start of the week." if day is "Monday".
Logs "End of the workweek." if day is "Friday".
Logs "It's a regular day." if no cases match.

Note: Without break, execution continues to the next case statements (fall-through behavior).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Looping Statements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looping statements are used to execute a block of code repeatedly based on a condition.&lt;br&gt;
&lt;strong&gt;1. JavaScript for Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The for loop is used when the number of iterations is known.&lt;/p&gt;

&lt;p&gt;for (let i = 1; i &amp;lt;= 3; i++) {&lt;/p&gt;

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

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initializes a counter, checks condition, and updates it in each iteration.
Executes the block until the condition becomes false.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. JavaScript while Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The while loop runs as long as the condition is true.&lt;/p&gt;

&lt;p&gt;let i = 1;&lt;/p&gt;

&lt;p&gt;while (i &amp;lt;= 3) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(i);

i++;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checks the condition before each iteration.
Executes the block only if the condition is true.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. JavaScript do...while Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The do...while loop executes the block at least once, even if the condition is false.&lt;/p&gt;

&lt;p&gt;let i = 1;&lt;/p&gt;

&lt;p&gt;do {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(i);

i++;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} while (i &amp;lt;= 3);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Executes the block first, then checks the condition.
Ensures at least one execution.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Ternary Operator or Conditional Operator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In some programming languages, a ternary operator is used to assign a value to a variable based on a condition.&lt;br&gt;
ternary_operator_or_conditional_operator&lt;/p&gt;

&lt;p&gt;let a = 10;&lt;/p&gt;

&lt;p&gt;console.log(a === 5 ? "a is equal to 5" : "a is not equal to 5");&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 10; assigns the value 10 to variable a.
a === 5 ? ... : ... checks if a is strictly equal to 5.
Returns "a is equal to 5" if true.
Returns "a is not equal to 5" if false.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Uses of Control Flow Statements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Control flow statements are backbone in programming for&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decision-Making: To execute specific blocks of code based on conditions (e.g., if, if...else).&lt;/li&gt;
&lt;li&gt;    Branching: To exit loops or skip iterations (break, continue).&lt;/li&gt;
&lt;li&gt;    Looping: To repeat tasks (for, while, do...while).&lt;/li&gt;
&lt;li&gt;    Switching: To handle multiple conditions effectively (switch).&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
