<?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: Osama Abu Motlaq</title>
    <description>The latest articles on DEV Community by Osama Abu Motlaq (@abumotlaq).</description>
    <link>https://dev.to/abumotlaq</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%2F4096097%2Ff23a5797-19bf-4285-8c2d-89a529941e8e.png</url>
      <title>DEV Community: Osama Abu Motlaq</title>
      <link>https://dev.to/abumotlaq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abumotlaq"/>
    <language>en</language>
    <item>
      <title>From a Real-World Problem to a Software Project: The Idea Behind Haseen.</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Tue, 20 Oct 2026 11:48:55 +0000</pubDate>
      <link>https://dev.to/abumotlaq/from-a-real-world-problem-to-a-software-project-the-idea-behind-haseen-i63</link>
      <guid>https://dev.to/abumotlaq/from-a-real-world-problem-to-a-software-project-the-idea-behind-haseen-i63</guid>
      <description>&lt;h1&gt;
  
  
  From a Real-World Problem to a Software Project: The Idea Behind Haseen
&lt;/h1&gt;

&lt;p&gt;Every software project should begin with a question worth answering.&lt;/p&gt;

&lt;p&gt;Not which framework to use. Not which library to install. Not how the dashboard should look.&lt;/p&gt;

&lt;p&gt;But &lt;strong&gt;what problem am I trying to solve, and why does it matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That question led me to the idea behind Haseen a project focused on identity and access governance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Who Should Have Access to What?
&lt;/h2&gt;

&lt;p&gt;Imagine a company with dozens or hundreds of employees.&lt;/p&gt;

&lt;p&gt;Each employee needs access to specific systems, files, and resources to perform their job. An accountant might need access to financial reports, while an HR employee needs access to personnel records.&lt;/p&gt;

&lt;p&gt;Now imagine an accountant accidentally having access to confidential HR files, or a former team member retaining permissions they no longer need.&lt;/p&gt;

&lt;p&gt;These situations raise important questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who has access to a particular resource?&lt;/li&gt;
&lt;li&gt;Are those permissions actually necessary for the employee's role?&lt;/li&gt;
&lt;li&gt;How can administrators review and manage permissions without losing track of them?&lt;/li&gt;
&lt;li&gt;What happens when someone needs temporary access to a resource outside their usual responsibilities?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As organizations grow, answering these questions becomes more complicated. Managing permissions is not simply about granting or denying access. It is about maintaining control, visibility, and accountability over time.&lt;/p&gt;

&lt;p&gt;That is the problem space I wanted to explore.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing Haseen
&lt;/h2&gt;

&lt;p&gt;Haseen is an in-progress project built around the idea of an identity and access governance dashboard.&lt;/p&gt;

&lt;p&gt;The goal is to provide administrators with a structured interface for reviewing employee permissions, understanding access relationships, and managing access requests.&lt;/p&gt;

&lt;p&gt;Rather than treating permissions as a collection of disconnected settings, I want Haseen to present them in a way that makes their relationships easier to understand.&lt;/p&gt;

&lt;p&gt;The project revolves around three main ideas.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Understanding Permissions
&lt;/h3&gt;

&lt;p&gt;Administrators need a clear picture of which employees have which permissions.&lt;/p&gt;

&lt;p&gt;A permission matrix can help make this relationship visible by presenting employees, roles, and permissions in a structured format.&lt;/p&gt;

&lt;p&gt;A permission tree can provide another way to navigate resources and understand how access is organized.&lt;/p&gt;

&lt;p&gt;These are not just visual components. Their design affects how easily someone can identify an unexpected permission or understand the consequences of a change.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Managing Access Through Roles
&lt;/h3&gt;

&lt;p&gt;Instead of assigning every permission independently to every employee, a system can use roles to organize access.&lt;/p&gt;

&lt;p&gt;For example, an accountant role might include permissions related to financial reports and accounting tools.&lt;/p&gt;

&lt;p&gt;Employees assigned to that role receive the permissions associated with it, subject to the system's access rules.&lt;/p&gt;

&lt;p&gt;This introduces an important design consideration: roles and permissions have a many-to-many relationship. A role can contain multiple permissions, and the same permission can belong to multiple roles.&lt;/p&gt;

&lt;p&gt;Modeling these relationships correctly matters because the interface must represent the underlying data accurately. A visually convincing dashboard is not enough if its data model cannot express the rules it is supposed to manage.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Temporary Access Requests
&lt;/h3&gt;

&lt;p&gt;Some employees occasionally need access to resources outside their normal responsibilities.&lt;/p&gt;

&lt;p&gt;Giving them permanent access may create unnecessary risk, especially when the requirement is temporary.&lt;/p&gt;

&lt;p&gt;Haseen explores the idea of temporary access requests, allowing access to be requested for a limited period.&lt;/p&gt;

&lt;p&gt;For example, an employee might need access to a particular resource to complete a short-term task. That access should have a defined expiration rather than remain available indefinitely.&lt;/p&gt;

&lt;p&gt;There is an important engineering detail here: &lt;strong&gt;temporary access expiration must be enforced by the backend, not merely by a frontend timer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The interface can display the expiration time and communicate the request's status, but the server must enforce the actual access rules.&lt;/p&gt;

&lt;p&gt;This distinction is one of the architectural considerations I want to understand as the project develops.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Chose This Project
&lt;/h2&gt;

&lt;p&gt;I did not want to build another dashboard that only displays charts, cards, and tables.&lt;/p&gt;

&lt;p&gt;I wanted a project with a meaningful problem behind its interface, where the design requires more than arranging components on a screen.&lt;/p&gt;

&lt;p&gt;Haseen provides an opportunity to explore several engineering challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modeling relationships between users, roles, and permissions.&lt;/li&gt;
&lt;li&gt;Designing interfaces for complex data rather than isolated components.&lt;/li&gt;
&lt;li&gt;Managing filtering, searching, and navigation through a large set of records.&lt;/li&gt;
&lt;li&gt;Representing different states of access requests clearly.&lt;/li&gt;
&lt;li&gt;Thinking about security boundaries and the responsibilities of the frontend and backend.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these challenges creates an opportunity to make deliberate design decisions and understand why those decisions matter.&lt;/p&gt;

&lt;p&gt;The project also gives me a reason to think beyond individual React components. A component may work correctly in isolation, but it still needs to fit into a consistent data model and a coherent application structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why React and TypeScript?
&lt;/h2&gt;

&lt;p&gt;My current focus is frontend development, particularly React and TypeScript, so I am approaching Haseen primarily from that perspective.&lt;/p&gt;

&lt;p&gt;React provides a way to organize the interface into reusable components and manage the relationships between different parts of the UI.&lt;/p&gt;

&lt;p&gt;TypeScript adds explicit types that help describe entities such as users, roles, permissions, and access requests. It also makes different states easier to represent clearly.&lt;/p&gt;

&lt;p&gt;For example, an access request might be pending, approved, rejected, or expired. Modeling these states deliberately can make the application's behavior easier to reason about than relying on arbitrary strings scattered throughout the codebase.&lt;/p&gt;

&lt;p&gt;However, neither React nor TypeScript automatically makes an application secure. Real access control requires backend enforcement, appropriate data handling, and careful authorization checks.&lt;/p&gt;

&lt;p&gt;Understanding where the frontend's responsibilities end—and where the backend's responsibilities begin—is part of what makes this project valuable to me.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Than Building a UI
&lt;/h2&gt;

&lt;p&gt;One of the most important things I want to get out of Haseen is a deeper understanding of software engineering decisions.&lt;/p&gt;

&lt;p&gt;Why should relationships between roles and permissions be modeled in a particular way?&lt;/p&gt;

&lt;p&gt;Which state belongs in the URL, which belongs in the UI, and which should come from the server?&lt;/p&gt;

&lt;p&gt;How should an interface communicate that an operation is pending, has failed, or is no longer allowed?&lt;/p&gt;

&lt;p&gt;What should happen when two administrators make conflicting changes?&lt;/p&gt;

&lt;p&gt;These questions do not always have one universally correct answer. The right approach depends on the requirements, constraints, and architecture of the system.&lt;/p&gt;

&lt;p&gt;Working through them is an important part of moving from writing components that work to designing software that is maintainable and reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Haseen Stands Today
&lt;/h2&gt;

&lt;p&gt;Haseen is still a work in progress.&lt;/p&gt;

&lt;p&gt;My current priority is building a solid frontend foundation, improving the data modeling, and understanding the architectural decisions behind the interface. I am not presenting it as a completed enterprise access governance platform or a production-ready security product.&lt;/p&gt;

&lt;p&gt;Instead, I see it as an opportunity to develop a more disciplined approach to building software around a real problem.&lt;/p&gt;

&lt;p&gt;There is still more to explore, particularly around backend authorization, persistence, and enforcing temporary access rules. Those concerns need to be understood and implemented properly before a system of this kind could be trusted with real organizational access.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The idea behind Haseen is straightforward: make employee permissions easier to understand, review, and manage.&lt;/p&gt;

&lt;p&gt;The engineering challenge is turning that idea into a system whose interface, data model, and access rules work together consistently.&lt;/p&gt;

&lt;p&gt;For me, that is what makes the project worth building.&lt;/p&gt;

&lt;p&gt;I want Haseen to be more than a portfolio screenshot. I want it to be a project through which I can demonstrate how I approach problems, make technical decisions, and improve my understanding of software engineering.&lt;/p&gt;

&lt;p&gt;Because building software is not just about making something work.&lt;/p&gt;

&lt;p&gt;It is about understanding &lt;strong&gt;what should work, why it should work that way, and what it takes to make it reliable.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Haseen (حصين) is an ongoing personal project exploring identity and access governance through React, TypeScript, and software engineering fundamentals.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>security</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>A Beginner's Guide</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:53:07 +0000</pubDate>
      <link>https://dev.to/abumotlaq/a-beginners-guide-4k8h</link>
      <guid>https://dev.to/abumotlaq/a-beginners-guide-4k8h</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07" class="crayons-story__hidden-navigation-link"&gt;Using TypeScript with React: A Beginner's Guide&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/abumotlaq" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F4096097%2Ff23a5797-19bf-4285-8c2d-89a529941e8e.png" alt="abumotlaq profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/abumotlaq" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Osama Abu Motlaq
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Osama Abu Motlaq
                
                
              
              &lt;div id="story-author-preview-content-4777962" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/abumotlaq" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F4096097%2Ff23a5797-19bf-4285-8c2d-89a529941e8e.png" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Osama Abu Motlaq&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 30&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07" id="article-link-4777962"&gt;
          Using TypeScript with React: A Beginner's Guide
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/react"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;react&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/typescript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;typescript&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Using TypeScript with React: A Beginner's Guide</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:50:10 +0000</pubDate>
      <link>https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07</link>
      <guid>https://dev.to/abumotlaq/using-typescript-with-react-a-beginners-guide-3o07</guid>
      <description>&lt;p&gt;If you are learning React and have started hearing about TypeScript everywhere, you may be wondering:&lt;/p&gt;

&lt;p&gt;Why should I use TypeScript with React?&lt;/p&gt;

&lt;p&gt;I recently started learning React with TypeScript, and one of the first things I noticed is that TypeScript helps make React code more predictable and easier to understand.&lt;/p&gt;

&lt;p&gt;In this article, I'll explain some of the basic concepts I have learned so far.&lt;/p&gt;

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

&lt;p&gt;TypeScript is a programming language built on top of JavaScript.&lt;/p&gt;

&lt;p&gt;It adds static typing to JavaScript, which means we can define what kind of data our variables, functions, and objects should contain.&lt;/p&gt;

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

&lt;p&gt;let username: string = "Osama";&lt;br&gt;
let age: number = 22;&lt;br&gt;
let isStudent: boolean = true;&lt;/p&gt;

&lt;p&gt;If we try to assign a number to username:&lt;/p&gt;

&lt;p&gt;username = 100;&lt;/p&gt;

&lt;p&gt;TypeScript will warn us because username was defined as a string.&lt;/p&gt;

&lt;p&gt;This can help us catch many mistakes while writing code instead of discovering them later at runtime.&lt;/p&gt;

&lt;p&gt;Why Use TypeScript with React?&lt;/p&gt;

&lt;p&gt;React applications often contain a lot of data moving between components.&lt;/p&gt;

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

&lt;p&gt;Props&lt;br&gt;
State&lt;br&gt;
Event handlers&lt;br&gt;
API responses&lt;br&gt;
Forms&lt;br&gt;
Context&lt;br&gt;
Reducers&lt;/p&gt;

&lt;p&gt;TypeScript allows us to describe the shape of this data.&lt;/p&gt;

&lt;p&gt;This becomes especially useful as an application grows.&lt;/p&gt;

&lt;p&gt;Typing React Props&lt;/p&gt;

&lt;p&gt;One of the first things I learned was how to type component props.&lt;/p&gt;

&lt;p&gt;Suppose we have a component that receives a user's name and age:&lt;/p&gt;

&lt;p&gt;type UserProps = {&lt;br&gt;
  name: string;&lt;br&gt;
  age: number;&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;const User = ({ name, age }: UserProps) =&amp;gt; {&lt;br&gt;
  return (&lt;br&gt;
    &lt;/p&gt;
&lt;br&gt;
      &lt;h2&gt;{name}&lt;/h2&gt;
&lt;br&gt;
      &lt;p&gt;Age: {age}&lt;/p&gt;
&lt;br&gt;
    &lt;br&gt;
  );&lt;br&gt;
};

&lt;p&gt;Now TypeScript knows exactly what this component expects.&lt;/p&gt;

&lt;p&gt;We can use it like this:&lt;/p&gt;



&lt;p&gt;But if we accidentally write:&lt;/p&gt;



&lt;p&gt;TypeScript will show errors because the values don't match the types we defined.&lt;/p&gt;

&lt;p&gt;What is children?&lt;/p&gt;

&lt;p&gt;React components can also receive something called children.&lt;/p&gt;

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

&lt;p&gt;type CardProps = {&lt;br&gt;
  children: React.ReactNode;&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;const Card = ({ children }: CardProps) =&amp;gt; {&lt;br&gt;
  return &lt;/p&gt;{children};&lt;br&gt;
};

&lt;p&gt;Now we can write:&lt;/p&gt;


&lt;h2&gt;Hello&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;This content is inside the Card.&lt;/p&gt;
&lt;br&gt;


&lt;p&gt;The content between  and  becomes the component's children.&lt;/p&gt;

&lt;p&gt;React.ReactNode is commonly used when we want a component to accept different types of React content, such as text, elements, or other components.&lt;/p&gt;

&lt;p&gt;Typing State with useState&lt;/p&gt;

&lt;p&gt;TypeScript can also help us with React state.&lt;/p&gt;

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

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

&lt;p&gt;Here we are telling TypeScript that count should be a number.&lt;/p&gt;

&lt;p&gt;We can then do:&lt;/p&gt;

&lt;p&gt;setCount(count + 1);&lt;/p&gt;

&lt;p&gt;But something like this would cause a type error:&lt;/p&gt;

&lt;p&gt;setCount("Hello");&lt;/p&gt;

&lt;p&gt;In many simple cases, TypeScript can infer the type automatically:&lt;/p&gt;

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

&lt;p&gt;TypeScript understands that count is a number.&lt;/p&gt;

&lt;p&gt;Typing Events&lt;/p&gt;

&lt;p&gt;React event handlers are another area where TypeScript is very useful.&lt;/p&gt;

&lt;p&gt;For example, with an input:&lt;/p&gt;

&lt;p&gt;type InputProps = {&lt;br&gt;
  value: string;&lt;br&gt;
  handleChange: (&lt;br&gt;
    event: React.ChangeEvent&lt;br&gt;
  ) =&amp;gt; void;&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;Now TypeScript knows that handleChange receives a React change event from an HTML input.&lt;/p&gt;

&lt;p&gt;We can use it like this:&lt;/p&gt;

&lt;p&gt;const Input = ({ value, handleChange }: InputProps) =&amp;gt; {&lt;br&gt;
  return (&lt;br&gt;
    
      value={value}&lt;br&gt;
      onChange={handleChange}&lt;br&gt;
    /&amp;gt;&lt;br&gt;
  );&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;This gives us better autocomplete and helps prevent mistakes when working with events.&lt;/p&gt;

&lt;p&gt;TypeScript and useReducer&lt;/p&gt;

&lt;p&gt;TypeScript becomes particularly useful when working with useReducer.&lt;/p&gt;

&lt;p&gt;For example, we can define the possible actions:&lt;/p&gt;

&lt;p&gt;type UpdateAction = {&lt;br&gt;
  type: "increment" | "decrement";&lt;br&gt;
  payload: number;&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;type ResetAction = {&lt;br&gt;
  type: "reset";&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;type CounterAction = UpdateAction | ResetAction;&lt;/p&gt;

&lt;p&gt;Now our reducer knows which actions are allowed.&lt;/p&gt;

&lt;p&gt;const reducer = (&lt;br&gt;
  state: CounterState,&lt;br&gt;
  action: CounterAction&lt;br&gt;
) =&amp;gt; {&lt;br&gt;
  switch (action.type) {&lt;br&gt;
    case "increment":&lt;br&gt;
      return {&lt;br&gt;
        count: state.count + action.payload,&lt;br&gt;
      };&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case "decrement":
  return {
    count: state.count - action.payload,
  };

case "reset":
  return {
    count: 0,
  };

default:
  return state;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;This is one of the areas where I started to see why TypeScript is useful with React.&lt;/p&gt;

&lt;p&gt;Instead of passing arbitrary strings and values around, we can clearly define which actions are valid.&lt;/p&gt;

&lt;p&gt;TypeScript Doesn't Replace Understanding React&lt;/p&gt;

&lt;p&gt;One important thing I have learned is that TypeScript does not replace understanding React.&lt;/p&gt;

&lt;p&gt;You still need to understand:&lt;/p&gt;

&lt;p&gt;Components&lt;br&gt;
Props&lt;br&gt;
State&lt;br&gt;
Events&lt;br&gt;
Hooks&lt;br&gt;
Rendering&lt;br&gt;
Component composition&lt;/p&gt;

&lt;p&gt;TypeScript simply adds a type system that helps us describe and validate the data used by our React application.&lt;/p&gt;

&lt;p&gt;For me, the best approach is to learn React concepts first and then understand how TypeScript describes those concepts.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;Using TypeScript with React can feel a little difficult at first.&lt;/p&gt;

&lt;p&gt;There are new concepts such as:&lt;/p&gt;

&lt;p&gt;Types&lt;br&gt;
Interfaces&lt;br&gt;
Union types&lt;br&gt;
Generics&lt;br&gt;
Type inference&lt;br&gt;
React.ReactNode&lt;br&gt;
Event types&lt;/p&gt;

&lt;p&gt;But once you understand the basics, TypeScript starts to make React code easier to reason about.&lt;/p&gt;

&lt;p&gt;I'm still learning React and TypeScript, and one of the things I like most about this combination is that the code becomes more explicit about what data a component expects and what it can return.&lt;/p&gt;

&lt;p&gt;There is still a lot for me to learn, but learning TypeScript alongside React has already changed the way I think about writing React applications.&lt;/p&gt;

&lt;p&gt;If you're also learning React with TypeScript, don't try to memorize everything at once. Learn one concept, use it in a small component, and gradually build from there.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>I Learned React Before I Truly Understood JavaScript — Here's What Happened</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Wed, 26 Aug 2026 18:02:31 +0000</pubDate>
      <link>https://dev.to/abumotlaq/i-learned-react-before-i-truly-understood-javascript-heres-what-happened-33cg</link>
      <guid>https://dev.to/abumotlaq/i-learned-react-before-i-truly-understood-javascript-heres-what-happened-33cg</guid>
      <description>&lt;p&gt;If you're learning web development today, there's a good chance your journey looks something like this:&lt;br&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%2Fhw8g3mxgq8nzuhcq8645.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%2Fhw8g3mxgq8nzuhcq8645.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML → CSS → JavaScript → React → Next.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At least, that's how it is supposed to go.&lt;/p&gt;

&lt;p&gt;But what if you skip the part where you truly understand JavaScript?&lt;/p&gt;

&lt;p&gt;That's exactly what I did.&lt;/p&gt;

&lt;p&gt;I learned React before I had a solid understanding of JavaScript, and at first, it felt like I was making incredible progress.&lt;/p&gt;

&lt;p&gt;I could build components.&lt;/p&gt;

&lt;p&gt;I could use &lt;code&gt;useState&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I could fetch data.&lt;/p&gt;

&lt;p&gt;I could create forms.&lt;/p&gt;

&lt;p&gt;I could build pages that looked like real applications.&lt;/p&gt;

&lt;p&gt;Everything seemed fine.&lt;/p&gt;

&lt;p&gt;Until it wasn't.&lt;/p&gt;

&lt;p&gt;Eventually, I started encountering problems that React couldn't explain for me.&lt;/p&gt;

&lt;p&gt;And that's when I realized something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;I wasn't struggling with React. I was struggling with JavaScript.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  React Made Me Feel Like I Was Progressing
&lt;/h2&gt;

&lt;p&gt;When you start learning React, the progress can feel exciting.&lt;/p&gt;

&lt;p&gt;You write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you learn components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;UserCard&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then effects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;fetchUsers&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And suddenly, you're building applications.&lt;/p&gt;

&lt;p&gt;That feels like real progress.&lt;/p&gt;

&lt;p&gt;But there was a problem.&lt;/p&gt;

&lt;p&gt;I could write the syntax.&lt;/p&gt;

&lt;p&gt;I couldn't always explain what was happening underneath it.&lt;/p&gt;




&lt;h1&gt;
  
  
  The First Warning Sign: Array Methods
&lt;/h1&gt;

&lt;p&gt;One of the first things that exposed this problem was something as simple as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;activeUsers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;active&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I knew that &lt;code&gt;filter()&lt;/code&gt; returned an array.&lt;/p&gt;

&lt;p&gt;But I didn't initially understand the function being passed to it.&lt;/p&gt;

&lt;p&gt;What exactly was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;active&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why does it run multiple times?&lt;/p&gt;

&lt;p&gt;Where does &lt;code&gt;user&lt;/code&gt; come from?&lt;/p&gt;

&lt;p&gt;Why does &lt;code&gt;filter()&lt;/code&gt; return a new array?&lt;/p&gt;

&lt;p&gt;These aren't React questions.&lt;/p&gt;

&lt;p&gt;They're JavaScript questions.&lt;/p&gt;

&lt;p&gt;And React uses these concepts everywhere.&lt;/p&gt;




&lt;h1&gt;
  
  
  Then Came Destructuring
&lt;/h1&gt;

&lt;p&gt;React code is full of destructuring.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, I treated this as React syntax.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;

&lt;p&gt;It's JavaScript.&lt;/p&gt;

&lt;p&gt;The second example is simply array destructuring applied to the value returned by &lt;code&gt;useState()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once I understood destructuring properly, React code became much easier to read.&lt;/p&gt;




&lt;h1&gt;
  
  
  Then I Met the Spread Operator
&lt;/h1&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;updatedUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Osama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I knew that this was commonly used in React.&lt;/p&gt;

&lt;p&gt;But knowing &lt;strong&gt;how to use it&lt;/strong&gt; and understanding &lt;strong&gt;what it actually does&lt;/strong&gt; are two different things.&lt;/p&gt;

&lt;p&gt;The spread syntax is JavaScript.&lt;/p&gt;

&lt;p&gt;React doesn't own it.&lt;/p&gt;

&lt;p&gt;React simply makes heavy use of JavaScript features like this.&lt;/p&gt;

&lt;p&gt;The same applies to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;some&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your JavaScript foundation is weak, React code can quickly become a collection of syntax that you memorize instead of concepts that you understand.&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;code&gt;useState&lt;/code&gt; Wasn't the Real Problem
&lt;/h1&gt;

&lt;p&gt;At some point, I started asking:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Why does React need state?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I knew how to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But understanding React state requires a deeper understanding of JavaScript concepts.&lt;/p&gt;

&lt;p&gt;Variables.&lt;/p&gt;

&lt;p&gt;References.&lt;/p&gt;

&lt;p&gt;Objects.&lt;/p&gt;

&lt;p&gt;Functions.&lt;/p&gt;

&lt;p&gt;Closures.&lt;/p&gt;

&lt;p&gt;Immutability.&lt;/p&gt;

&lt;p&gt;Execution.&lt;/p&gt;

&lt;p&gt;Re-rendering.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Osama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ali&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes the existing object.&lt;/p&gt;

&lt;p&gt;But in React, you will often work with state like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ali&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because understanding object references and immutable updates becomes important when working with React state.&lt;/p&gt;

&lt;p&gt;Without understanding JavaScript, React's rules can feel arbitrary.&lt;/p&gt;




&lt;h1&gt;
  
  
  Then &lt;code&gt;this&lt;/code&gt; Appeared
&lt;/h1&gt;

&lt;p&gt;JavaScript's &lt;code&gt;this&lt;/code&gt; was another wake-up call.&lt;/p&gt;

&lt;p&gt;I had seen code like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Osama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I encountered arrow functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Osama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="na"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why do these behave differently?&lt;/p&gt;

&lt;p&gt;Why does &lt;code&gt;this&lt;/code&gt; depend on how a function is called?&lt;/p&gt;

&lt;p&gt;Why don't arrow functions have their own &lt;code&gt;this&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;These aren't React concepts.&lt;/p&gt;

&lt;p&gt;But if you don't understand them, JavaScript can feel unpredictable.&lt;/p&gt;

&lt;p&gt;And when JavaScript feels unpredictable, React becomes even more confusing.&lt;/p&gt;




&lt;h1&gt;
  
  
  Closures Changed Everything
&lt;/h1&gt;

&lt;p&gt;Closures were probably one of the most important concepts I eventually had to understand.&lt;/p&gt;

&lt;p&gt;Consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The returned function can still access &lt;code&gt;count&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because of closures.&lt;/p&gt;

&lt;p&gt;And closures are not some obscure JavaScript feature that only matters in interviews.&lt;/p&gt;

&lt;p&gt;They are fundamental to understanding how functions retain access to variables from their surrounding scope.&lt;/p&gt;

&lt;p&gt;Once you understand closures, many concepts in modern JavaScript start making more sense.&lt;/p&gt;

&lt;p&gt;Including patterns you encounter when working with React.&lt;/p&gt;




&lt;h1&gt;
  
  
  Async JavaScript Was Another Story
&lt;/h1&gt;

&lt;p&gt;Then came API requests.&lt;/p&gt;

&lt;p&gt;I started with something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I knew how to write the code.&lt;/p&gt;

&lt;p&gt;But understanding asynchronous JavaScript required much more than memorizing &lt;code&gt;async&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I had to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Promises&lt;/li&gt;
&lt;li&gt;Callbacks&lt;/li&gt;
&lt;li&gt;The Event Loop&lt;/li&gt;
&lt;li&gt;Microtasks&lt;/li&gt;
&lt;li&gt;Asynchronous execution&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And suddenly, something that looked like a React problem turned out to be a JavaScript problem again.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Biggest Mistake Was Learning Syntax Instead of Concepts
&lt;/h1&gt;

&lt;p&gt;Looking back, I wasn't really learning React.&lt;/p&gt;

&lt;p&gt;I was learning how to make React code work.&lt;/p&gt;

&lt;p&gt;There's a big difference.&lt;/p&gt;

&lt;p&gt;Learning syntax looks like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I write &lt;code&gt;useEffect&lt;/code&gt;?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning concepts looks like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What problem is &lt;code&gt;useEffect&lt;/code&gt; solving, and what does this code actually do?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning syntax:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I update state?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning concepts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why does React care about state updates and references?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning syntax:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How do I fetch data?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Learning concepts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How does asynchronous JavaScript work, and what happens while I'm waiting for the response?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second approach takes longer.&lt;/p&gt;

&lt;p&gt;But it creates a much stronger developer.&lt;/p&gt;




&lt;h1&gt;
  
  
  React Started Making More Sense After I Went Back
&lt;/h1&gt;

&lt;p&gt;Eventually, I made what felt like a step backward.&lt;/p&gt;

&lt;p&gt;I went back to JavaScript.&lt;/p&gt;

&lt;p&gt;Not because React was bad.&lt;/p&gt;

&lt;p&gt;Not because I wanted to abandon modern development.&lt;/p&gt;

&lt;p&gt;I went back because I needed the foundation.&lt;/p&gt;

&lt;p&gt;I started focusing on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Variables
Data Types
Functions
Arrays
Objects
Scope
Closures
this
Prototypes
Destructuring
Spread Syntax
Array Methods
Promises
async/await
Event Loop
Modules
DOM
Events
Error Handling
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And something interesting happened.&lt;/p&gt;

&lt;p&gt;I didn't feel like I was starting over.&lt;/p&gt;

&lt;p&gt;I was finally connecting the pieces.&lt;/p&gt;




&lt;h1&gt;
  
  
  React Became a Layer Instead of a Mystery
&lt;/h1&gt;

&lt;p&gt;Before that, React sometimes felt like a collection of special rules.&lt;/p&gt;

&lt;p&gt;After understanding JavaScript better, I started seeing React differently.&lt;/p&gt;

&lt;p&gt;React became another layer on top of concepts I already understood.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;UserCard&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"That's React syntax."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;code&gt;map()&lt;/code&gt; is JavaScript. The arrow function is JavaScript. The object being passed is JavaScript. React is using these concepts to describe UI."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That distinction is extremely important.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Framework Shouldn't Be the Foundation
&lt;/h1&gt;

&lt;p&gt;A framework should sit &lt;strong&gt;on top of your fundamentals&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Not replace them.&lt;/p&gt;

&lt;p&gt;Think about it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                Next.js
                   ↓
                 React
                   ↓
              JavaScript
                   ↓
          Programming Fundamentals
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the bottom layer is weak, everything above it becomes harder.&lt;/p&gt;

&lt;p&gt;You can still build things.&lt;/p&gt;

&lt;p&gt;You can still follow tutorials.&lt;/p&gt;

&lt;p&gt;You can still copy patterns from documentation.&lt;/p&gt;

&lt;p&gt;But debugging becomes much harder.&lt;/p&gt;

&lt;p&gt;And sooner or later, you'll encounter a problem that the tutorial didn't cover.&lt;/p&gt;

&lt;p&gt;That's when fundamentals matter.&lt;/p&gt;




&lt;h1&gt;
  
  
  Does This Mean You Should Master JavaScript Before React?
&lt;/h1&gt;

&lt;p&gt;Not necessarily.&lt;/p&gt;

&lt;p&gt;I don't think you need to spend years learning JavaScript before touching React.&lt;/p&gt;

&lt;p&gt;You can learn both together.&lt;/p&gt;

&lt;p&gt;The important part is &lt;strong&gt;not letting React replace your JavaScript learning&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A healthy learning path could look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML + CSS
      ↓
JavaScript Fundamentals
      ↓
Small Vanilla JS Projects
      ↓
React
      ↓
Advanced JavaScript
      ↓
Next.js / Node.js
      ↓
Full Stack Development
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't have to know everything before moving forward.&lt;/p&gt;

&lt;p&gt;But whenever React exposes a JavaScript concept you don't understand, stop and learn that concept.&lt;/p&gt;

&lt;p&gt;That's much better than memorizing the React-specific solution.&lt;/p&gt;




&lt;h1&gt;
  
  
  Build Something Without React
&lt;/h1&gt;

&lt;p&gt;One of the best things I did was build projects using Vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;Not because Vanilla JavaScript is better than React.&lt;/p&gt;

&lt;p&gt;But because it forced me to understand what was happening.&lt;/p&gt;

&lt;p&gt;For example, building a Todo application without React makes you think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM manipulation&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;State&lt;/li&gt;
&lt;li&gt;Data structures&lt;/li&gt;
&lt;li&gt;Array methods&lt;/li&gt;
&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;Local Storage&lt;/li&gt;
&lt;li&gt;Rendering&lt;/li&gt;
&lt;li&gt;Updating the UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then when you build the same kind of application with React, you start appreciating what React is actually solving.&lt;/p&gt;

&lt;p&gt;You don't just use the abstraction.&lt;/p&gt;

&lt;p&gt;You understand &lt;strong&gt;why the abstraction is useful&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Real Lesson
&lt;/h1&gt;

&lt;p&gt;The biggest lesson wasn't:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Don't learn React early."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The lesson was:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Don't let learning React prevent you from learning JavaScript."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React is an incredibly powerful tool.&lt;/p&gt;

&lt;p&gt;But tools change.&lt;/p&gt;

&lt;p&gt;Frameworks change.&lt;/p&gt;

&lt;p&gt;Libraries become unpopular.&lt;/p&gt;

&lt;p&gt;New technologies appear.&lt;/p&gt;

&lt;p&gt;The fundamentals remain.&lt;/p&gt;

&lt;p&gt;If tomorrow you move from React to another framework, your JavaScript knowledge comes with you.&lt;/p&gt;

&lt;p&gt;That's your transferable skill.&lt;/p&gt;




&lt;h1&gt;
  
  
  If You're Learning React Right Now
&lt;/h1&gt;

&lt;p&gt;Don't panic if you're already learning React.&lt;/p&gt;

&lt;p&gt;You don't need to throw away everything you've learned.&lt;/p&gt;

&lt;p&gt;Instead, whenever you encounter something you don't understand, ask:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Is this actually a React concept, or is it JavaScript?"&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;map()&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Destructuring?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Spread syntax?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Closures?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Promises?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;async/await&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Modules?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Objects and references?&lt;/p&gt;

&lt;p&gt;JavaScript.&lt;/p&gt;

&lt;p&gt;Once you start making this distinction, your learning becomes much more structured.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Learning React before deeply understanding JavaScript wasn't a complete mistake.&lt;/p&gt;

&lt;p&gt;It actually taught me something valuable.&lt;/p&gt;

&lt;p&gt;It showed me exactly &lt;strong&gt;why fundamentals matter&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;React can help you build applications faster.&lt;/p&gt;

&lt;p&gt;But JavaScript helps you understand what your application is actually doing.&lt;/p&gt;

&lt;p&gt;You don't have to choose between modern frameworks and strong fundamentals.&lt;/p&gt;

&lt;p&gt;Learn both.&lt;/p&gt;

&lt;p&gt;Use React.&lt;/p&gt;

&lt;p&gt;Build with Next.js.&lt;/p&gt;

&lt;p&gt;Work with Node.js.&lt;/p&gt;

&lt;p&gt;Explore the ecosystem.&lt;/p&gt;

&lt;p&gt;But whenever you feel that a framework is doing something "magical," go one level deeper.&lt;/p&gt;

&lt;p&gt;Ask what's happening underneath.&lt;/p&gt;

&lt;p&gt;Because eventually, you'll discover that much of the "magic" isn't magic at all.&lt;/p&gt;

&lt;p&gt;It's JavaScript.&lt;/p&gt;

&lt;p&gt;And the better you understand JavaScript, the less mysterious React becomes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Don't learn React to avoid JavaScript. Learn JavaScript so you can truly understand React.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Vanilla JavaScript — Why It Still Matters in the Age of React and Next.js</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Wed, 26 Aug 2026 17:39:22 +0000</pubDate>
      <link>https://dev.to/abumotlaq/vanilla-javascript-why-it-still-matters-in-the-age-of-react-and-nextjs-2a7o</link>
      <guid>https://dev.to/abumotlaq/vanilla-javascript-why-it-still-matters-in-the-age-of-react-and-nextjs-2a7o</guid>
      <description>&lt;h1&gt;
  
  
  Vanilla JavaScript — Why It Still Matters in the Age of React and Next.js
&lt;/h1&gt;

&lt;p&gt;In modern web development, it's easy to feel like JavaScript alone is no longer enough.&lt;/p&gt;

&lt;p&gt;You open GitHub or LinkedIn and see:&lt;/p&gt;

&lt;p&gt;React.&lt;/p&gt;

&lt;p&gt;Next.js.&lt;/p&gt;

&lt;p&gt;Vue.&lt;/p&gt;

&lt;p&gt;Angular.&lt;/p&gt;

&lt;p&gt;TypeScript.&lt;/p&gt;

&lt;p&gt;Vite.&lt;/p&gt;

&lt;p&gt;And sometimes dozens of libraries that a project seems to need before you even write your first line of code.&lt;/p&gt;

&lt;p&gt;So beginners often ask:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"If all these tools exist, why should I learn Vanilla JavaScript?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a reasonable question.&lt;/p&gt;

&lt;p&gt;But the problem is that many developers learn the tools built on top of JavaScript before understanding the language those tools are built on.&lt;/p&gt;

&lt;p&gt;It's like learning to drive a modern car without understanding the basics of controlling a vehicle.&lt;/p&gt;

&lt;p&gt;You may be able to drive.&lt;/p&gt;

&lt;p&gt;But when something unexpected happens, it becomes much harder to understand why.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Does Vanilla JavaScript Mean?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Vanilla JavaScript&lt;/strong&gt; isn't a different programming language.&lt;/p&gt;

&lt;p&gt;It's simply a term developers use when they mean JavaScript without a framework or library such as React or Vue.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#btn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Button clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's Vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;No React.&lt;/p&gt;

&lt;p&gt;No Vue.&lt;/p&gt;

&lt;p&gt;No jQuery.&lt;/p&gt;

&lt;p&gt;Just JavaScript and the Web APIs provided by the browser.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why Does a React Developer Need Vanilla JavaScript?
&lt;/h1&gt;

&lt;p&gt;Because React doesn't replace JavaScript.&lt;/p&gt;

&lt;p&gt;React is built with JavaScript and runs within the JavaScript ecosystem.&lt;/p&gt;

&lt;p&gt;When you write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you're using JavaScript.&lt;/p&gt;

&lt;p&gt;When you write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you're using JavaScript.&lt;/p&gt;

&lt;p&gt;And when you work with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Promise
async
await
fetch
map
filter
reduce
objects
arrays
destructuring
modules
closures
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you're working with JavaScript.&lt;/p&gt;

&lt;p&gt;React provides a way to organize and build user interfaces.&lt;/p&gt;

&lt;p&gt;It doesn't replace the language itself.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Problem Starts When You Learn a Framework Before the Language
&lt;/h1&gt;

&lt;p&gt;Imagine someone starts learning development like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML
↓
React
↓
Next.js
↓
Node.js
↓
MongoDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They can build a beautiful page.&lt;/p&gt;

&lt;p&gt;But when they encounter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;they don't know why &lt;code&gt;filter&lt;/code&gt; works.&lt;/p&gt;

&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;active&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;they don't understand Spread Syntax.&lt;/p&gt;

&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;they don't understand what &lt;code&gt;await&lt;/code&gt; actually does.&lt;/p&gt;

&lt;p&gt;That's when the problem becomes clear.&lt;/p&gt;

&lt;p&gt;A developer can use a framework without truly understanding the language underneath it.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Framework Is Not a Replacement for Fundamentals
&lt;/h1&gt;

&lt;p&gt;Frameworks solve important problems.&lt;/p&gt;

&lt;p&gt;React, for example, helps developers build user interfaces in a structured and reusable way.&lt;/p&gt;

&lt;p&gt;Next.js adds a large set of capabilities on top of React for building web applications.&lt;/p&gt;

&lt;p&gt;But when something goes wrong inside these tools, you often end up going back to JavaScript.&lt;/p&gt;

&lt;p&gt;This happens all the time.&lt;/p&gt;

&lt;p&gt;The problem might involve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scope&lt;/li&gt;
&lt;li&gt;Closures&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;References&lt;/li&gt;
&lt;li&gt;Asynchronous JavaScript&lt;/li&gt;
&lt;li&gt;Promises&lt;/li&gt;
&lt;li&gt;Event Loop&lt;/li&gt;
&lt;li&gt;Modules&lt;/li&gt;
&lt;li&gt;DOM&lt;/li&gt;
&lt;li&gt;Browser APIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The stronger your JavaScript foundation is, the easier frameworks become.&lt;/p&gt;




&lt;h1&gt;
  
  
  Vanilla JavaScript Forces You to Understand What Is Happening
&lt;/h1&gt;

&lt;p&gt;When you use a framework, many details are organized or abstracted away from you.&lt;/p&gt;

&lt;p&gt;That's a good thing.&lt;/p&gt;

&lt;p&gt;But when you work with Vanilla JavaScript, you are forced to interact with things such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps you understand the relationship between JavaScript and the browser.&lt;/p&gt;

&lt;p&gt;You're not just learning how to write code.&lt;/p&gt;

&lt;p&gt;You're learning about the environment in which that code runs.&lt;/p&gt;




&lt;h1&gt;
  
  
  The DOM Is Not JavaScript
&lt;/h1&gt;

&lt;p&gt;This is a very important distinction.&lt;/p&gt;

&lt;p&gt;Many beginners assume that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is part of the JavaScript language itself.&lt;/p&gt;

&lt;p&gt;The reality is more precise.&lt;/p&gt;

&lt;p&gt;JavaScript is a programming language.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document&lt;/code&gt;, &lt;code&gt;window&lt;/code&gt;, &lt;code&gt;localStorage&lt;/code&gt;, &lt;code&gt;fetch&lt;/code&gt;, and many other APIs are provided by the environment in which JavaScript runs.&lt;/p&gt;

&lt;p&gt;In a browser, you have Web APIs.&lt;/p&gt;

&lt;p&gt;In Node.js, you have a different set of APIs.&lt;/p&gt;

&lt;p&gt;Understanding this distinction becomes increasingly important as you go deeper into JavaScript.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Simple Example
&lt;/h1&gt;

&lt;p&gt;Suppose we have a button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"btn"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click me&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can interact with it using Vanilla JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#btn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Several things are happening here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JavaScript gets a reference to the element.&lt;/li&gt;
&lt;li&gt;The browser provides the &lt;code&gt;document&lt;/code&gt; API.&lt;/li&gt;
&lt;li&gt;We register an event listener.&lt;/li&gt;
&lt;li&gt;The browser waits for a &lt;code&gt;click&lt;/code&gt; event.&lt;/li&gt;
&lt;li&gt;When the event occurs, the callback function runs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you understand this process, many React concepts become easier to understand.&lt;/p&gt;




&lt;h1&gt;
  
  
  React Doesn't Make These Concepts Disappear
&lt;/h1&gt;

&lt;p&gt;When you write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Clicked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      Click me
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it may look completely different.&lt;/p&gt;

&lt;p&gt;But the underlying ideas haven't disappeared.&lt;/p&gt;

&lt;p&gt;You still have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Callbacks&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;State&lt;/li&gt;
&lt;li&gt;Asynchronous behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React provides a different abstraction and structure for building user interfaces.&lt;/p&gt;

&lt;p&gt;But JavaScript is still underneath it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Vanilla JavaScript Teaches You to Solve Problems Before Reaching for a Library
&lt;/h1&gt;

&lt;p&gt;There is a common habit among some developers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I need to do X, so I'll find a library that does X."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That isn't always wrong.&lt;/p&gt;

&lt;p&gt;The problem starts when it becomes the only solution.&lt;/p&gt;

&lt;p&gt;A good developer asks first:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Do I actually need a library for this?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes the problem is extremely simple.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;uniqueUsers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need a library just to remove duplicate values.&lt;/p&gt;

&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;activeUsers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;active&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need a library to filter data.&lt;/p&gt;

&lt;p&gt;Or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userNames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need a library to extract values from an array.&lt;/p&gt;

&lt;p&gt;Understanding JavaScript reduces your dependence on libraries for simple problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  But This Doesn't Mean Vanilla JavaScript Is Always Better
&lt;/h1&gt;

&lt;p&gt;This is where we need to be realistic.&lt;/p&gt;

&lt;p&gt;I'm not saying:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Don't use React."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And I'm not saying:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Vanilla JavaScript is better than frameworks."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's not true.&lt;/p&gt;

&lt;p&gt;As an application grows, manually managing the UI, state, and component structure can become complicated.&lt;/p&gt;

&lt;p&gt;That's where frameworks and libraries become valuable.&lt;/p&gt;

&lt;p&gt;The problem isn't using tools.&lt;/p&gt;

&lt;p&gt;The problem is using them without understanding the problem they're solving.&lt;/p&gt;




&lt;h1&gt;
  
  
  When Should You Use Vanilla JavaScript?
&lt;/h1&gt;

&lt;p&gt;Vanilla JavaScript is excellent for projects such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple interactive websites&lt;/li&gt;
&lt;li&gt;Landing pages&lt;/li&gt;
&lt;li&gt;Small tools&lt;/li&gt;
&lt;li&gt;Scripts&lt;/li&gt;
&lt;li&gt;Widgets&lt;/li&gt;
&lt;li&gt;Prototypes&lt;/li&gt;
&lt;li&gt;Educational projects&lt;/li&gt;
&lt;li&gt;Projects that don't require a framework&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's also excellent for learning.&lt;/p&gt;

&lt;p&gt;Because you interact directly with JavaScript and the browser.&lt;/p&gt;




&lt;h1&gt;
  
  
  When Do You Need React or a Framework?
&lt;/h1&gt;

&lt;p&gt;As a project grows, you may need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Component Architecture&lt;/li&gt;
&lt;li&gt;State Management&lt;/li&gt;
&lt;li&gt;Reusable UI&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Complex Interactions&lt;/li&gt;
&lt;li&gt;Data Fetching&lt;/li&gt;
&lt;li&gt;Large Application Structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At that point, frameworks such as React and Next.js can become a logical choice.&lt;/p&gt;

&lt;p&gt;But using these tools doesn't make understanding JavaScript less important.&lt;/p&gt;

&lt;p&gt;It makes it even more important.&lt;/p&gt;




&lt;h1&gt;
  
  
  Vanilla JavaScript Is Not a Phase You Should Leave Behind
&lt;/h1&gt;

&lt;p&gt;Sometimes Vanilla JavaScript is treated as a temporary stage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JavaScript
↓
React
↓
Forget JavaScript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the better path looks more like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JavaScript
↓
Deep JavaScript Understanding
↓
React
↓
Next.js
↓
Full Stack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each stage builds on the previous one.&lt;/p&gt;

&lt;p&gt;You don't move from JavaScript to React so that you can forget JavaScript.&lt;/p&gt;

&lt;p&gt;You move to React because you're ready to use a higher-level tool.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Should You Understand Before React?
&lt;/h1&gt;

&lt;p&gt;You don't need to become an expert in everything.&lt;/p&gt;

&lt;p&gt;But you should be comfortable with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Variables
Data Types
Functions
Arrays
Objects
Destructuring
Spread Syntax
Rest Parameters
Array Methods
Scope
Closures
this
DOM
Events
Promises
async/await
Fetch API
Modules
Error Handling
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you start learning React, many concepts will already feel familiar.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Best Way to Learn Vanilla JavaScript
&lt;/h1&gt;

&lt;p&gt;Don't just watch tutorials.&lt;/p&gt;

&lt;p&gt;Build small projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Todo List
&lt;/h3&gt;

&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DOM&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Local Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Weather App
&lt;/h3&gt;

&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch&lt;/li&gt;
&lt;li&gt;Promises&lt;/li&gt;
&lt;li&gt;Async/Await&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Error Handling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quiz App
&lt;/h3&gt;

&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State-like logic&lt;/li&gt;
&lt;li&gt;Events&lt;/li&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Conditional Rendering&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Expense Tracker
&lt;/h3&gt;

&lt;p&gt;You'll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data manipulation&lt;/li&gt;
&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;Local Storage&lt;/li&gt;
&lt;li&gt;Array methods&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After building these projects, React will feel much less mysterious.&lt;/p&gt;




&lt;h1&gt;
  
  
  JavaScript First, Tools Second
&lt;/h1&gt;

&lt;p&gt;One of the biggest challenges in the modern JavaScript ecosystem is the sheer number of tools.&lt;/p&gt;

&lt;p&gt;Every week, a new library may appear.&lt;/p&gt;

&lt;p&gt;A new framework.&lt;/p&gt;

&lt;p&gt;A new tool.&lt;/p&gt;

&lt;p&gt;A new way of building applications.&lt;/p&gt;

&lt;p&gt;If you try to memorize all of them, you'll enter a race that never ends.&lt;/p&gt;

&lt;p&gt;But if you understand JavaScript well, you can learn new tools much faster.&lt;/p&gt;

&lt;p&gt;Because you aren't starting from zero.&lt;/p&gt;

&lt;p&gt;You're simply learning:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use a new tool to solve a problem you already understand.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Vanilla JavaScript isn't a competitor to React.&lt;/p&gt;

&lt;p&gt;And it's not an outdated technology that should be discarded.&lt;/p&gt;

&lt;p&gt;It's the foundation that makes React, Node.js, Next.js, and the rest of the JavaScript ecosystem easier to understand.&lt;/p&gt;

&lt;p&gt;You can learn a framework without deeply understanding JavaScript.&lt;/p&gt;

&lt;p&gt;You may even be able to build a working application.&lt;/p&gt;

&lt;p&gt;But when something unexpected happens, you'll often find yourself searching for a ready-made solution instead of understanding the underlying cause.&lt;/p&gt;

&lt;p&gt;When your foundation is strong, frameworks become tools.&lt;/p&gt;

&lt;p&gt;And that's the real goal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't learn JavaScript just so you can use React.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn JavaScript so you can understand what React is doing when you use it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the end, the best developer isn't the person who knows the largest number of libraries.&lt;/p&gt;

&lt;p&gt;It's the person who understands the problem, knows when to use JavaScript directly, knows when a higher-level tool is needed, and—most importantly—understands why.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vanillajavascript</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JavaScript — A Programming Mess That Succeeded by Accident</title>
      <dc:creator>Osama Abu Motlaq</dc:creator>
      <pubDate>Wed, 26 Aug 2026 17:14:12 +0000</pubDate>
      <link>https://dev.to/abumotlaq/javascript-a-programming-mess-that-succeeded-by-accident-938</link>
      <guid>https://dev.to/abumotlaq/javascript-a-programming-mess-that-succeeded-by-accident-938</guid>
      <description>&lt;h1&gt;
  
  
  JavaScript — A Programming Mess That Succeeded by Accident
&lt;/h1&gt;

&lt;p&gt;If you've been writing JavaScript for a while, you've probably had a moment when you asked yourself:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Why was the language designed this way?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Why do we have &lt;code&gt;==&lt;/code&gt; and &lt;code&gt;===&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Why are there both &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;undefined&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Why can the result of some operations be so strange?&lt;/p&gt;

&lt;p&gt;Why does &lt;code&gt;this&lt;/code&gt; behave differently depending on how a function is called?&lt;/p&gt;

&lt;p&gt;And why do you sometimes need to understand the history of the language to understand why certain behaviors exist?&lt;/p&gt;

&lt;p&gt;It's easy to look at JavaScript and say that it's a language full of strange design decisions.&lt;/p&gt;

&lt;p&gt;But the truth is more interesting.&lt;/p&gt;

&lt;p&gt;JavaScript wasn't originally built to become the language we know today.&lt;/p&gt;

&lt;p&gt;It started as a simple language for the web, then expanded dramatically and eventually became a fundamental part of modern web development—from the browser to the server, from mobile applications to developer tools.&lt;/p&gt;

&lt;p&gt;That's why it can be described, somewhat humorously, as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;JavaScript — a programming mess that succeeded by accident.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But was it really an accident?&lt;/p&gt;




&lt;h1&gt;
  
  
  The Beginning Was Much Simpler
&lt;/h1&gt;

&lt;p&gt;When JavaScript appeared in the mid-1990s, the goal wasn't to build massive modern applications.&lt;/p&gt;

&lt;p&gt;The primary goal was to add some interactivity to web pages.&lt;/p&gt;

&lt;p&gt;The web at that time was completely different from the web we know today.&lt;/p&gt;

&lt;p&gt;There was no React, Vue, or Angular.&lt;/p&gt;

&lt;p&gt;There was no Node.js.&lt;/p&gt;

&lt;p&gt;Modern web applications didn't exist in their current form.&lt;/p&gt;

&lt;p&gt;Web pages relied heavily on HTML, and there was a growing need for a language that could interact with the page and add dynamic behavior.&lt;/p&gt;

&lt;p&gt;And that's where JavaScript came in.&lt;/p&gt;

&lt;p&gt;The problem was that the language evolved incredibly quickly.&lt;/p&gt;

&lt;p&gt;What seemed like a reasonable decision at the time eventually became part of the language that had to be preserved because of compatibility with millions of websites and applications.&lt;/p&gt;

&lt;p&gt;And that's where the real story of JavaScript begins.&lt;/p&gt;




&lt;p&gt;One of the biggest reasons JavaScript can feel strange is that the language cannot simply throw away its history.&lt;/p&gt;

&lt;p&gt;When a programming language is used by millions of projects, changing old behavior can potentially break a huge number of applications.&lt;/p&gt;

&lt;p&gt;As a result, many historical behaviors have to remain.&lt;/p&gt;

&lt;p&gt;Even when they no longer look like the best possible design.&lt;/p&gt;

&lt;p&gt;And this explains a large part of the "mess."&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;code&gt;==&lt;/code&gt; vs &lt;code&gt;===&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;One of the most famous examples is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason is that &lt;code&gt;==&lt;/code&gt; allows &lt;strong&gt;type coercion&lt;/strong&gt;, meaning that JavaScript may convert types during the comparison.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;===&lt;/code&gt;, on the other hand, compares both the value and the type without performing the same kind of implicit conversion.&lt;/p&gt;

&lt;p&gt;That's why you'll usually see developers prefer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;===&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;over:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;==&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not because &lt;code&gt;==&lt;/code&gt; doesn't work, but because &lt;code&gt;===&lt;/code&gt; is generally clearer and less likely to produce unexpected results.&lt;/p&gt;

&lt;p&gt;And this leads to one of the most important lessons in JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's not enough to know what the code does. You should understand why it does it.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;code&gt;null&lt;/code&gt; vs &lt;code&gt;undefined&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;We also have two values that may look very similar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kc"&gt;null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But they are used differently.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;undefined&lt;/code&gt; often means that a value hasn't been assigned or isn't available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// undefined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While &lt;code&gt;null&lt;/code&gt; is commonly used to explicitly represent the absence of a value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;selectedUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In other words, the developer is explicitly saying:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is a variable, but it currently has no value.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Having two different values for situations that can appear similar may seem confusing, but it's part of the language's history and behavior that has become part of the ecosystem.&lt;/p&gt;




&lt;h1&gt;
  
  
  &lt;code&gt;typeof null&lt;/code&gt;... Wait, What?
&lt;/h1&gt;

&lt;p&gt;Now we come to one of JavaScript's most famous oddities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;Even though &lt;code&gt;null&lt;/code&gt; isn't an object in the way a modern developer would normally expect.&lt;/p&gt;

&lt;p&gt;This is one of those behaviors that became part of the language's historical legacy.&lt;/p&gt;

&lt;p&gt;The lesson isn't simply to memorize this strange fact.&lt;/p&gt;

&lt;p&gt;The more important lesson is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming languages aren't always designed from scratch according to the best possible design.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some languages evolve on top of old decisions and have to maintain compatibility with the past.&lt;/p&gt;




&lt;h1&gt;
  
  
  JavaScript Isn't a "Bad Language"
&lt;/h1&gt;

&lt;p&gt;After seeing examples like these, it's easy to say:&lt;/p&gt;

&lt;p&gt;"JavaScript is a bad language."&lt;/p&gt;

&lt;p&gt;But that's an unfair conclusion.&lt;/p&gt;

&lt;p&gt;Every programming language has design decisions that not every developer will like.&lt;/p&gt;

&lt;p&gt;More importantly, modern JavaScript is not simply the same language that appeared in the 1990s.&lt;/p&gt;

&lt;p&gt;The language has evolved dramatically.&lt;/p&gt;

&lt;p&gt;Features such as these have been introduced:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Arrow Functions&lt;/li&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;Modules&lt;/li&gt;
&lt;li&gt;Promises&lt;/li&gt;
&lt;li&gt;&lt;code&gt;async/await&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Destructuring&lt;/li&gt;
&lt;li&gt;Spread Syntax&lt;/li&gt;
&lt;li&gt;Optional Chaining&lt;/li&gt;
&lt;li&gt;Nullish Coalescing&lt;/li&gt;
&lt;li&gt;Iterators&lt;/li&gt;
&lt;li&gt;Generators&lt;/li&gt;
&lt;li&gt;And many more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, instead of relying on older patterns for asynchronous operations, we can now write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows how the language has evolved to become more powerful and more comfortable to work with.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Problem Isn't Just JavaScript
&lt;/h1&gt;

&lt;p&gt;There is another important point to understand:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript is more than just a programming language.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is part of a huge ecosystem.&lt;/p&gt;

&lt;p&gt;Today, when you say JavaScript, you may be talking about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JavaScript
│
├── Browser
│
├── Node.js
│
├── React
│
├── Next.js
│
├── Express
│
├── TypeScript
│
├── npm
│
└── Thousands of libraries and tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this is one of JavaScript's greatest strengths.&lt;/p&gt;

&lt;p&gt;The language started as a scripting language inside the browser, but it eventually became the foundation of an entire development ecosystem.&lt;/p&gt;




&lt;h1&gt;
  
  
  From the Browser to the Server
&lt;/h1&gt;

&lt;p&gt;One of the biggest transformations in JavaScript's history was the emergence of Node.js.&lt;/p&gt;

&lt;p&gt;Suddenly, JavaScript was no longer limited to the browser.&lt;/p&gt;

&lt;p&gt;Developers could use JavaScript to build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web Servers&lt;/li&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;Backend Applications&lt;/li&gt;
&lt;li&gt;CLI Tools&lt;/li&gt;
&lt;li&gt;Automation&lt;/li&gt;
&lt;li&gt;Real-time Applications&lt;/li&gt;
&lt;li&gt;Developer Tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made JavaScript one of the few languages that developers can use across both sides of an application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend
   ↓
JavaScript
   ↓
Backend
   ↓
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then came powerful frameworks and libraries such as React, Express, Next.js, and many others.&lt;/p&gt;




&lt;h1&gt;
  
  
  Its Success Wasn't Entirely Accidental
&lt;/h1&gt;

&lt;p&gt;The title of this article says:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"A Programming Mess That Succeeded by Accident."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But if we want to be more precise, JavaScript's success wasn't simply an accident.&lt;/p&gt;

&lt;p&gt;Many factors contributed to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. It Was Already in the Browser
&lt;/h2&gt;

&lt;p&gt;JavaScript became a fundamental part of the web.&lt;/p&gt;

&lt;p&gt;That gave it an enormous user base.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. It Was Easy to Get Started With
&lt;/h2&gt;

&lt;p&gt;You could simply write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You didn't need to build a complicated project just to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Language Kept Evolving
&lt;/h2&gt;

&lt;p&gt;JavaScript didn't stop at its original design.&lt;/p&gt;

&lt;p&gt;It continued to evolve and introduce new capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The Rise of Node.js
&lt;/h2&gt;

&lt;p&gt;Node.js dramatically expanded JavaScript's use beyond the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. A Massive Ecosystem
&lt;/h2&gt;

&lt;p&gt;The existence of npm, libraries, frameworks, and developer tools made JavaScript capable of handling many different types of projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. React and What Came After
&lt;/h2&gt;

&lt;p&gt;Modern frontend libraries and frameworks made JavaScript an essential part of building large web applications.&lt;/p&gt;




&lt;h1&gt;
  
  
  What Should a JavaScript Developer Learn?
&lt;/h1&gt;

&lt;p&gt;One of the biggest mistakes beginners can make is jumping directly into a framework.&lt;/p&gt;

&lt;p&gt;They might start like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML
↓
React
↓
Next.js
↓
Node.js
↓
MongoDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then they encounter a simple JavaScript problem and have no idea why it happens.&lt;/p&gt;

&lt;p&gt;A better approach is to build a strong foundation first.&lt;/p&gt;

&lt;p&gt;Start by understanding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Variables
Data Types
Operators
Functions
Arrays
Objects
Scope
Closures
this
Prototypes
Classes
DOM
Events
Promises
Async/Await
Modules
Error Handling
Fetch API
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then move on to frameworks and ecosystem tools.&lt;/p&gt;

&lt;p&gt;Because React won't make you a good JavaScript developer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding JavaScript will make you a better React developer.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Don't Memorize JavaScript's Weirdness — Understand It
&lt;/h1&gt;

&lt;p&gt;You may find long lists online titled:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"100 Weird Things About JavaScript."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They're entertaining, but that's not the real goal.&lt;/p&gt;

&lt;p&gt;A good developer doesn't memorize:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;just to prove that they know JavaScript's quirks.&lt;/p&gt;

&lt;p&gt;What matters more is understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type Coercion&lt;/li&gt;
&lt;li&gt;Equality&lt;/li&gt;
&lt;li&gt;Scope&lt;/li&gt;
&lt;li&gt;Execution Context&lt;/li&gt;
&lt;li&gt;Closures&lt;/li&gt;
&lt;li&gt;Prototypes&lt;/li&gt;
&lt;li&gt;Event Loop&lt;/li&gt;
&lt;li&gt;Asynchronous JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you understand these concepts, many of JavaScript's "weird" behaviors stop being mysterious and become predictable.&lt;/p&gt;




&lt;h1&gt;
  
  
  Sometimes the Mess Is Part of the Success
&lt;/h1&gt;

&lt;p&gt;That's the interesting paradox of JavaScript.&lt;/p&gt;

&lt;p&gt;If the language had disappeared because of its early design flaws, we wouldn't have what we have today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;React
Next.js
Node.js
Express
Electron
React Native
Vite
npm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And thousands of tools and libraries built around JavaScript and TypeScript.&lt;/p&gt;

&lt;p&gt;Its massive success created a new problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It became extremely difficult to change the past.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's why modern JavaScript carries layers of history on top of each other.&lt;/p&gt;

&lt;p&gt;Old decisions.&lt;/p&gt;

&lt;p&gt;New features.&lt;/p&gt;

&lt;p&gt;Backward compatibility.&lt;/p&gt;

&lt;p&gt;Modern tools.&lt;/p&gt;

&lt;p&gt;Frameworks.&lt;/p&gt;

&lt;p&gt;Libraries.&lt;/p&gt;

&lt;p&gt;All working together within one enormous ecosystem.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;JavaScript isn't a perfect language.&lt;/p&gt;

&lt;p&gt;And honestly, I don't think there is such a thing as a perfect programming language.&lt;/p&gt;

&lt;p&gt;But JavaScript is an excellent example of how &lt;strong&gt;success in programming isn't determined only by the quality of a language's original design.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes the deciding factors are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timing&lt;/li&gt;
&lt;li&gt;Adoption&lt;/li&gt;
&lt;li&gt;Community&lt;/li&gt;
&lt;li&gt;Ecosystem&lt;/li&gt;
&lt;li&gt;Backward compatibility&lt;/li&gt;
&lt;li&gt;The ability to evolve&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So perhaps the better description is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;JavaScript isn't simply a mess that succeeded by accident. It's a language that started small, accumulated decades of history, and evolved into one of the foundations of the modern web.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're learning JavaScript today, don't try to run away from the strange parts of the language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understand them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because the more you understand why the language behaves the way it does, the less you rely on memorization—and the better you become at writing predictable, maintainable code.&lt;/p&gt;

&lt;p&gt;And in the end, that's the difference between someone who knows JavaScript...&lt;/p&gt;

&lt;p&gt;and someone who &lt;strong&gt;understands JavaScript&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
