<?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: Kamalesh AR</title>
    <description>The latest articles on DEV Community by Kamalesh AR (@kamalesh_ar_6252544786997).</description>
    <link>https://dev.to/kamalesh_ar_6252544786997</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%2F3925287%2F12ec5ab2-2cb6-4e9b-88b0-8c11abacd4eb.png</url>
      <title>DEV Community: Kamalesh AR</title>
      <link>https://dev.to/kamalesh_ar_6252544786997</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kamalesh_ar_6252544786997"/>
    <language>en</language>
    <item>
      <title>My journey exploring to presentation about RAG - Retrieval Augmented Generation</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Tue, 21 Jul 2026 15:41:28 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/my-journey-exploring-to-presentation-about-rag-retrieval-augmented-generation-16a8</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/my-journey-exploring-to-presentation-about-rag-retrieval-augmented-generation-16a8</guid>
      <description>&lt;p&gt;Recently, I had the opportunity to deliver a presentation on Retrieval-Augmented Generation (RAG) at my institute. Preparing for this session helped me understand not only what RAG is, but also why it has become one of the most important techniques in modern AI applications.&lt;/p&gt;

&lt;p&gt;In this blog, I'd like to share what I learned and explain RAG in a simple way.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is RAG:
&lt;/h2&gt;

&lt;p&gt;Retrieval-Augmented Generation (RAG) is the process of optimizing the output of a large language model, so it references an authoritative knowledge base outside of its training data sources before generating a response. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieval: Search for relevant information from documents, databases, or websites.&lt;/li&gt;
&lt;li&gt;Augmentation: Add the retrieved information to the user's question as additional context.&lt;/li&gt;
&lt;li&gt;Generation: The LLM uses both the question and the retrieved information to generate an accurate answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Large Language Models (LLMs) are trained on vast volumes of data and use billions of parameters to generate original output for tasks like answering questions, translating languages, and completing sentences. &lt;/p&gt;

&lt;p&gt;RAG extends the already powerful capabilities of LLMs to specific domains or an organization's internal knowledge base, all without the need to retrain the model. It is a cost-effective approach to improving LLM output so it remains relevant, accurate, and useful in various contexts.&lt;/p&gt;

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

&lt;p&gt;"What is my college's attendance policy?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without RAG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The AI only uses its training knowledge and might answer:&lt;/p&gt;

&lt;p&gt;"Most colleges require around 75% attendance."&lt;/p&gt;

&lt;p&gt;This is a generic answer and may not be correct for your college.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With RAG&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The AI first searches your college handbook, retrieves the attendance policy, and then answers:&lt;/p&gt;

&lt;p&gt;"According to your college handbook, students must maintain at least 80% attendance."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why RAG:
&lt;/h2&gt;

&lt;p&gt;LLMs are a key artificial intelligence (AI) technology powering intelligent chatbots and other natural language processing (NLP) applications. &lt;/p&gt;

&lt;p&gt;The goal is to create bots that can answer user questions in various contexts by cross-referencing authoritative knowledge sources. &lt;/p&gt;

&lt;p&gt;Unfortunately, the nature of LLM technology introduces unpredictability in LLM responses. Additionally, LLM training data is static and introduces a cut-off date on the knowledge it has.&lt;/p&gt;

&lt;h2&gt;
  
  
  Known challenges included:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Presenting false information when it does not have the answer.&lt;/li&gt;
&lt;li&gt;Presenting out-of-date or generic information when the user expects a specific, current response.&lt;/li&gt;
&lt;li&gt;Creating a response from non-authoritative sources.&lt;/li&gt;
&lt;li&gt;Creating inaccurate responses due to terminology confusion, wherein different training sources use the same terminology to talk about different things.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Working:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Query Processing: The input query is first pre-processed and prepared for further steps, ensuring it is in a suitable form for embedding.&lt;/li&gt;
&lt;li&gt;Embedding Model: The query is passed through an embedding model that converts it into a vector capturing its semantic meaning.&lt;/li&gt;
&lt;li&gt;Vector Database Retrieval: This vector is used to search a vector database to find documents that are most similar to the query.&lt;/li&gt;
&lt;li&gt;Retrieved Contexts: The system retrieves the documents that are closest to the query. These documents are then forwarded to the generative model to help it craft a response.&lt;/li&gt;
&lt;li&gt;LLM Response Generation: The LLM combines the original query with the retrieved context to generate a coherent and accurate response.&lt;/li&gt;
&lt;li&gt;Response: The final response integrates both the model’s internal knowledge and the retrieved information, making it more relevant and up-to-date.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo2bcw72m0uun9q9d1wja.webp" 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%2Fo2bcw72m0uun9q9d1wja.webp" alt=" " width="800" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Three pillars of RAG:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmb13p4e7dqqc87phnfux.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%2Fmb13p4e7dqqc87phnfux.png" alt=" " width="798" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular RAG Tools:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;LLM's:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chatgpt&lt;/li&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;li&gt;Llama&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Vector Databases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FAISS &lt;/li&gt;
&lt;li&gt;Pinecone &lt;/li&gt;
&lt;li&gt;ChromaDB &lt;/li&gt;
&lt;li&gt;Milvus&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;LangChain &lt;/li&gt;
&lt;li&gt;LlamaIndex &lt;/li&gt;
&lt;li&gt;Haystack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Embedding Models:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI Embeddings &lt;/li&gt;
&lt;li&gt;BGE &lt;/li&gt;
&lt;li&gt;E5 &lt;/li&gt;
&lt;li&gt;Sentence Transformers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Purpose:
&lt;/h2&gt;

&lt;p&gt;The purpose of a Retrieval-Augmented Generation (RAG) model is to improve the accuracy and relevance of AI responses by pulling facts from external knowledge bases rather than relying solely on its static training data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Grounding in Factuality&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The primary purpose of RAG is to anchor Large Language Models in verified, authoritative source material. By feeding the exact context along with the query, RAG dramatically reduces hallucinations and equips the system to cite sources transparently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Dynamic Data Integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of relying on a static knowledge window frozen during pre-training, RAG dynamically pulls live enterprise data, inventory lists, internal wikis, or real-time APIs. This ensures answers are always current without requiring costly, slow model retraining cycles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhqjudtvjatqan7nrjawr.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%2Fhqjudtvjatqan7nrjawr.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rag</category>
      <category>ai</category>
      <category>llm</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Usestate in React</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Fri, 17 Jul 2026 14:11:24 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/usestate-in-react-42ao</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/usestate-in-react-42ao</guid>
      <description>&lt;h2&gt;
  
  
  Usestate
&lt;/h2&gt;

&lt;p&gt;The React useState Hook allows us to track state in a function component.&lt;br&gt;
useState is a React Hook that allows functional components to store and update data (state). Whenever the state changes, React automatically re-renders the component to display the updated UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setState&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="nx"&gt;initialValue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;state - The current value.&lt;br&gt;
setState - Function used to update the state.&lt;br&gt;
initialValue - The initial value of the state.&lt;/p&gt;
&lt;h2&gt;
  
  
  Import useState
&lt;/h2&gt;

&lt;p&gt;To use the useState Hook, we first need to import it into our component.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&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;Notice that we are destructuring useState from react as it is a named export.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initialize usestate
&lt;/h2&gt;

&lt;p&gt;We initialize our state by calling useState in our function component.&lt;/p&gt;

&lt;p&gt;useState accepts an initial state and returns two values:&lt;/p&gt;

&lt;p&gt;The current state.&lt;br&gt;
A function that updates the state.&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;FavoriteColor&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setColor&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&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;Notice that again, we are destructuring the returned values from useState.&lt;/p&gt;

&lt;p&gt;The first value, color, is our current state.&lt;/p&gt;

&lt;p&gt;The second value, setColor, is the function that is used to update our state.&lt;/p&gt;

&lt;p&gt;Lastly, we set the initial state to "red": useState("red")&lt;/p&gt;

&lt;h2&gt;
  
  
  Read State
&lt;/h2&gt;

&lt;p&gt;We can now include our state anywhere in our component&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createRoot&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;FavoriteColor&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setColor&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&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;My favorite color is &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;color&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;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;createRoot&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;render&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;FavoriteColor&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;h2&gt;
  
  
  Update State
&lt;/h2&gt;

&lt;p&gt;To update our state, we use our state updater function.&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&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="nf"&gt;setColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&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;Blue&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;EXample&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createRoot&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;FavoriteColor&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setColor&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&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;&amp;gt;&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;My favorite color is &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;color&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;h1&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;button&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&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="nf"&gt;setColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&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;Blue&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;&amp;lt;/&amp;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;createRoot&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;render&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;FavoriteColor&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;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/react/react_usestate.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/react/react_usestate.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>REACT - Vite,Components and npm</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Wed, 15 Jul 2026 15:03:24 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/react-vitecomponents-and-npm-58c1</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/react-vitecomponents-and-npm-58c1</guid>
      <description>&lt;h2&gt;
  
  
  Vite:
&lt;/h2&gt;

&lt;p&gt;Vite (pronounced "veet", French for "quick") is a modern frontend build tool that helps developers create web applications faster.&lt;/p&gt;

&lt;p&gt;It provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A development server&lt;/li&gt;
&lt;li&gt;Fast hot reloading&lt;/li&gt;
&lt;li&gt;A build system for production&lt;/li&gt;
&lt;li&gt;Project scaffolding for frameworks like React, Vue, Svelte, and others&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of configuring everything manually (Webpack, Babel, etc.), Vite gives you a ready-to-use development environment.&lt;/p&gt;

&lt;p&gt;Have you seen or heard about Vite? Vite is the 12th-ranked bundling tool used by 2023 Stack Overflow selection developers. Here’s what Wikipedia defines as Vite.&lt;/p&gt;

&lt;p&gt;Vite (French: [vit], like “veet”) is a local development server written by Evan You,[1] the creator of Vue.js, and used by default by Vue and for React project templates. It has support for TypeScript and JSX. It uses Rollup and esbuild internally for bundling.&lt;/p&gt;

&lt;p&gt;It’s a pretty clear explanation, but today’s story is a longer and easier way to understand Vite. First, there’s a background you need to know to understand Vite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we use Vite?
&lt;/h2&gt;

&lt;p&gt;Before Vite, tools like Create React App (CRA) and Webpack were commonly used.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Slow startup time&lt;/li&gt;
&lt;li&gt;Slow rebuilds as the project grew&lt;/li&gt;
&lt;li&gt;Longer development cycles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vite solves these problems by making development much faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With vite:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write Code
     ↓
Vite serves files directly
     ↓
Only changed module reloads
     ↓
Browser updates instantly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Without vite:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write Code
     ↓
Webpack bundles entire project
     ↓
Browser loads application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Typical vite project structure:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-app/
│
├── public/
├── src/
│   ├── App.jsx
│   ├── main.jsx
│   └── assets/
│
├── package.json
├── vite.config.js
└── node_modules/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Components:
&lt;/h2&gt;

&lt;p&gt;Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation and return HTML.&lt;/p&gt;

&lt;p&gt;Components come in two types, Class components and Function components, in this tutorial we will concentrate on Function components.&lt;/p&gt;

&lt;p&gt;In older React code bases, you may find Class components primarily used.&lt;/p&gt;

&lt;p&gt;It is now suggested to use Function components along with Hooks, instead of Class components.&lt;/p&gt;

&lt;p&gt;Class components are still supported, check the Class components section for more information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A component is a reusable piece of UI (User Interface).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of writing the same HTML multiple times, you create a component once and use it wherever needed.&lt;/p&gt;

&lt;p&gt;Think of a website like a set of LEGO blocks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navbar&lt;/li&gt;
&lt;li&gt;Button&lt;/li&gt;
&lt;li&gt;Card&lt;/li&gt;
&lt;li&gt;Footer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each block is a component&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With components:&lt;/strong&gt;&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;ProductCard&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="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"card"&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;iPhone 16&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;₹80,000&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;&lt;strong&gt;Without components:&lt;/strong&gt;&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;iPhone 16&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;₹80,000&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Samsung S25&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;₹75,000&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Pixel 10&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;₹70,000&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Node package manager(NPM):
&lt;/h2&gt;

&lt;p&gt;npm stands for Node Package Manager.&lt;/p&gt;

&lt;p&gt;npm is the world's largest Software Registry.&lt;/p&gt;

&lt;p&gt;The registry contains over 800,000 code packages.&lt;/p&gt;

&lt;p&gt;Open-source developers use npm to share software.&lt;/p&gt;

&lt;p&gt;Many organizations also use npm to manage private development.&lt;/p&gt;

&lt;p&gt;It is the default package manager for Node.js. npm helps you install, manage, update, and remove packages (libraries) that your project depends on.&lt;/p&gt;

&lt;p&gt;Think of npm as an app store for JavaScript libraries.&lt;/p&gt;

&lt;p&gt;For example, if you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Express&lt;/li&gt;
&lt;li&gt;Axios&lt;/li&gt;
&lt;li&gt;Lodash&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install them using npm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before the activation of JavaScript libraries and npm, developers used to deploy their projects by uploading HTML, CSS, and JavaScript files to the server. (In fact, in the big picture, there doesn’t seem to be much difference from current development practices.) Over time, as JavaScript libraries became more prevalent, developers started actively utilizing npm to make installing libraries easier. npm, in simple terms, is a platform for gathering JavaScript libraries. When you install an npm library, a folder named node_modules is created within your project directory. This folder contains the source code of the library and its dependencies. This allows developers to easily import modules, but it has two major drawbacks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The large size of the node_modules folder&lt;/li&gt;
&lt;li&gt;the fact that the import/require syntax was not browser-friendly at that time&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why we use npm?
&lt;/h2&gt;

&lt;p&gt;Instead of writing every feature from scratch, developers use packages created by others.&lt;/p&gt;

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

&lt;p&gt;Want to make HTTP requests? → Install axios&lt;br&gt;
Want routing in React? → Install react-router-dom&lt;br&gt;
Want icons? → Install react-icons&lt;/p&gt;

&lt;p&gt;npm downloads these packages and manages their versions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How npm works&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Developer
    │
    │ npm install react
    ▼
npm Registry (online repository)
    │
    ▼
Downloads React
    │
    ▼
node_modules/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reference:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/whatis/whatis_npm.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/whatis/whatis_npm.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/react/react_components.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/react/react_components.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@gmmicky1026/easy-explanation-about-vite-8a6493731fc4" rel="noopener noreferrer"&gt;https://medium.com/@gmmicky1026/easy-explanation-about-vite-8a6493731fc4&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CODE on JVM - Meetup</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Mon, 13 Jul 2026 08:05:24 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/code-on-jvm-meetup-1p6h</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/code-on-jvm-meetup-1p6h</guid>
      <description>&lt;p&gt;Yesterday, I attended the &lt;strong&gt;Code on JVM&lt;/strong&gt; meetup, where industry experts and experienced professionals delivered three insightful technical sessions. The event covered the following topics:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;DSA in Production – A Case Study&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Uncovering Ideas Worth Building in the AI Era&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Streaming Large File Downloads in Java&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each session provided practical insights, real-world experiences, and valuable knowledge on applying these concepts in the software industry. In this blog, I'll share the key takeaways and lessons I learned from each session.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. DSA in Production – A Case Study
&lt;/h2&gt;

&lt;p&gt;Taken by - &lt;strong&gt;Hareesh Rajendran (Founder &amp;amp; CEO, Hayan Tech)&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;This session demonstrated how data structures and algorithms are applied in large-scale production systems rather than just coding interviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bloom Filters&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A probabilistic data structure used to quickly check whether an element may exist.&lt;/li&gt;
&lt;li&gt;Extremely memory-efficient.&lt;/li&gt;
&lt;li&gt;Used in databases and caching systems to avoid unnecessary lookups.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;HyperLogLog&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used for estimating the number of unique elements in massive datasets.&lt;/li&gt;
&lt;li&gt;Requires very little memory.&lt;/li&gt;
&lt;li&gt;Based on probability and mathematical concepts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common use cases include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Counting unique Reddit users&lt;/li&gt;
&lt;li&gt;Google Analytics&lt;/li&gt;
&lt;li&gt;Analytics dashboards&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;LSM Trees (Log-Structured Merge Trees)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Optimized for high write performance.&lt;br&gt;
Widely used in databases handling large volumes of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistent Hashing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Helps distribute data across multiple servers.&lt;br&gt;
Reduces data movement when servers are added or removed.&lt;br&gt;
Commonly used in distributed systems and load balancing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HNSW Graph (Hierarchical Navigable Small World)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HNSW is a graph-based data structure that enables extremely fast similarity searches among millions of vectors. It is widely used in AI applications such as semantic search, recommendation systems, vector databases, and Retrieval-Augmented Generation (RAG).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skip List&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Skip List is a probabilistic data structure that provides fast search, insertion, and deletion operations by using multiple linked levels. It offers performance similar to balanced trees while being simpler to implement and is commonly used in Redis and database storage engines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hexagonal Grid (H3)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;H3 is a geospatial indexing system that divides the Earth's surface into hexagonal cells for efficient location-based processing. It is widely used by mapping, ride-sharing, and food delivery platforms to optimize routing, nearby searches, and geographic analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeways:&lt;/strong&gt;&lt;br&gt;
Totally about the data structure how it works, why it works by knowing this easyily understand the concept and above are DSA algorithm used in many use cases and case study.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Uncovering Ideas Worth Building in the AI Era
&lt;/h2&gt;

&lt;p&gt;Taken by - &lt;strong&gt;Agnel John D (Founder &amp;amp; CEO of Error makes clever)&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;This session focused on validating ideas before investing time in building products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons Learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building a product is easier than finding people who truly need it.&lt;/li&gt;
&lt;li&gt;Validate your idea by talking to potential users first.&lt;/li&gt;
&lt;li&gt;Identify customers who are willing to pay.&lt;/li&gt;
&lt;li&gt;Your first paying customers are the strongest proof that your idea solves a real problem.&lt;/li&gt;
&lt;li&gt;Once validation is complete, commit fully and execute with focus.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Takeways&lt;/strong&gt;&lt;br&gt;
How to use AI efficiently &lt;br&gt;
By using AI to build model&lt;br&gt;
How it works for working professions &lt;br&gt;
Then how prioritize the product to the market using AI&lt;/p&gt;

&lt;h2&gt;
  
  
  Session 3: Streaming Large File Downloads in Java
&lt;/h2&gt;

&lt;p&gt;Taken by - &lt;strong&gt;Kalaivani Mohan (Software Engineer, IBM)&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;The final session explained how &lt;strong&gt;streaming large file downloads&lt;/strong&gt; improves application performance. Instead of loading an entire file into memory, Java streams the file in smaller chunks, reducing memory usage and enabling faster, more scalable downloads. This technique is widely used for serving videos, PDFs, reports, cloud storage files, and other enterprise applications, making backend systems more efficient and reliable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeways&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This session is fully about the large file downloads for users. By split as chunk to n number of users with the help of Java.&lt;/p&gt;

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

&lt;p&gt;This meetup was an excellent learning experience. It highlighted how computer science concepts like Bloom Filters, HyperLogLog, LSM Trees, and Consistent Hashing power modern applications, while also emphasizing that successful AI products start with solving real customer problems—not just writing code.&lt;/p&gt;

&lt;p&gt;A big thanks to the speakers and organizers for sharing their practical experiences. Looking forward to attending more such sessions!&lt;/p&gt;

&lt;p&gt;#CodeOnJVM #Java #DSA #SystemDesign #AI #Software engineer&lt;/p&gt;

</description>
      <category>meetups</category>
      <category>techmeet</category>
      <category>java</category>
      <category>ai</category>
    </item>
    <item>
      <title>REACT</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Mon, 13 Jul 2026 07:34:34 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/react-3g7j</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/react-3g7j</guid>
      <description>&lt;h2&gt;
  
  
  About react:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;React is a JavaScript library for building user interfaces.&lt;/li&gt;
&lt;li&gt;React is used to build single-page applications.&lt;/li&gt;
&lt;li&gt;React allows us to create reusable UI components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;React (also known as React.js or ReactJS) is a free and open-source front-end JavaScript library that aims to make building user interfaces based on components more "seamless". It is maintained by Meta (formerly Facebook) and a community of individual developers and companies. According to the 2025 Stack Overflow Developer Survey, React is one of the most commonly used web technologies.&lt;/p&gt;

&lt;p&gt;React can be used to develop single-page, mobile, or server-rendered applications with frameworks like Next.js and React Router. Because React is only concerned with the user interface and rendering components to the DOM, React applications often rely on libraries for routing and other client-side functionality. A key advantage of React is that it only re-renders those parts of the page that have changed, avoiding unnecessary re-rendering of unchanged DOM elements. React is used by an estimated 6% of all websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React is a JavaScript library used to build interactive UI (User Interfaces), mainly for web apps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It was developed by Facebook (Meta) and is widely used in companies like Instagram, Netflix, etc.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why React is used?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fast &lt;/li&gt;
&lt;li&gt;Reusable &lt;/li&gt;
&lt;li&gt;Easy to manage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3 Core Concepts That Make React Work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Components (The Lego Bricks)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React splits the UI into independent, reusable pieces called Components. For example, on a page like UI, a navigation bar, a sidebar, and a video player are all separate components.&lt;/p&gt;

&lt;p&gt;You write a component once (like a Button) and reuse it across your entire app.&lt;/p&gt;

&lt;p&gt;Components are typically written using JSX (JavaScript XML), a syntax extension that lets you write HTML-like code directly inside your JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. State and Props (The Data Flow)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Data in React moves in two ways:&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Props (Properties): Think of these as configuration settings passed down from a parent component to a child component (like telling a button component what text to display). Props are read-only.&lt;/p&gt;

&lt;p&gt;State: This is a component's private, internal memory. If a user clicks a "Like" button, the count increases. That count is stored in the component's state. When state changes, the component automatically updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The Virtual DOM (The Speed Demon)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Traditionally, when data changes on a website, the browser has to recalculate and redraw the entire webpage. This is slow and performance-heavy.&lt;/p&gt;

&lt;p&gt;React solves this by creating a Virtual DOM—a lightweight, digital copy of the actual webpage kept in the computer's memory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When state changes, React updates the Virtual DOM first.&lt;/li&gt;
&lt;li&gt;It then compares the new Virtual DOM with a snapshot of the old one (a process called "diffing algorithm").&lt;/li&gt;
&lt;li&gt;React figures out exactly which tiny part changed and updates only that specific piece on the real screen, leaving the rest untouched.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Developers Choose React
&lt;/h2&gt;

&lt;p&gt;Declarative UI: You simply describe what the UI should look like based on the current data state, and React handles all the complex steps to update the screen.&lt;/p&gt;

&lt;p&gt;Massive Ecosystem: Because of its popularity, React has thousands of pre-built packages for routing, styling, and state management, plus React Native for building mobile apps.&lt;/p&gt;

&lt;p&gt;High Performance: The Virtual DOM ensures applications stay snappy even when handling complex, real-time data streams.&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/React/Default.ASP" rel="noopener noreferrer"&gt;https://www.w3schools.com/React/Default.ASP&lt;/a&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/React_(software)" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/React_(software)&lt;/a&gt;&lt;br&gt;
&lt;a href="https://react.dev/blog" rel="noopener noreferrer"&gt;https://react.dev/blog&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>ai</category>
    </item>
    <item>
      <title>Concept of closure in javascript</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Wed, 08 Jul 2026 16:17:45 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/concept-of-closure-in-javascript-3g66</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/concept-of-closure-in-javascript-3g66</guid>
      <description>&lt;h2&gt;
  
  
  Closures:
&lt;/h2&gt;

&lt;p&gt;A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, &lt;strong&gt;a closure gives a function access to its outer scope.&lt;/strong&gt; In JavaScript, closures are created every time a function is created, at function creation time.&lt;/p&gt;

&lt;p&gt;JavaScript variables can belong to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The local scope&lt;/li&gt;
&lt;li&gt;The global scope&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Global variables can be made local (private) with closures.&lt;/p&gt;

&lt;p&gt;Closures make it possible for a function to have "private" variables.&lt;/p&gt;

&lt;p&gt;A closure is created when a function remembers the variables from its outer scope, even after the outer function has finished executing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retains access to outer function variables.&lt;/li&gt;
&lt;li&gt;Preserves the lexical scope.&lt;/li&gt;
&lt;li&gt;Allows data encapsulation and privacy.&lt;/li&gt;
&lt;li&gt;Commonly used in callbacks and asynchronous code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lexical Scoping:
&lt;/h2&gt;

&lt;p&gt;Closures rely on lexical scoping, which means a function’s scope is determined by where it is defined, not where it is executed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function retains access to the scope where it was defined.&lt;/li&gt;
&lt;li&gt;Inner functions can access outer function variables.&lt;/li&gt;
&lt;li&gt;Enables closures to “remember” their environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Private Variables
&lt;/h2&gt;

&lt;p&gt;Closures allow a function to keep variables private and accessible only within that function, which is commonly used in modules to protect data from being accessed or modified by other parts of the program.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helps achieve data encapsulation&lt;/li&gt;
&lt;li&gt;Creates private variables&lt;/li&gt;
&lt;li&gt;Prevents accidental data modification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&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;makeAdder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&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;x&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;y&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;add5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;makeAdder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&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="nf"&gt;add5&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&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;myCounter&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;counter&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="c1"&gt;//variable in outer function&lt;/span&gt;
 &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;inner&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;//inner function uses other variable&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;counter&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="nx"&gt;inner&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;add&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;myCounter&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;span class="c1"&gt;//1&lt;/span&gt;
&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//2&lt;/span&gt;
&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//3&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;adding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;myCounter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;adding&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//1&lt;/span&gt;
&lt;span class="nf"&gt;adding&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//2&lt;/span&gt;
&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eventhough, the outer function has finished, the inner function remembers the count. This is called closure.&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/js/js_function_closures.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/js_function_closures.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/javascript/closure-in-javascript/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/javascript/closure-in-javascript/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>closure</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Callback hell and Promise</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Wed, 08 Jul 2026 15:46:59 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/callback-hell-and-promise-5a2j</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/callback-hell-and-promise-5a2j</guid>
      <description>&lt;h2&gt;
  
  
  Callback Hell:
&lt;/h2&gt;

&lt;p&gt;Callback Hell is a situation in JavaScript where multiple nested callback functions make your code look like it’s been through a blender on the highest setting.&lt;/p&gt;

&lt;p&gt;This typically occurs when dealing with asynchronous operations, such as making API requests or handling file I/O, where one operation depends on the result of another or previous One.&lt;/p&gt;

&lt;p&gt;A callback is simply a &lt;strong&gt;function passed as an argument to another function&lt;/strong&gt;. It gets executed after the first function finishes its work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Callback Hell (Pyramid of Doom):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;login(function () {

    selectFood(function () {

        makePayment(function () {

            placeOrder(function () {

                deliverFood(function () {

                    console.log("Enjoy your meal!");

                });

            });

        });

    });

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;login()
   |
   selectFood()
      |
      makePayment()
         |
         placeOrder()
            |
            deliverFood()
               |
           Enjoy Meal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj8aynuje0qeo4hz2x9ti.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%2Fj8aynuje0qeo4hz2x9ti.png" alt=" " width="421" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution to Callback Hell&lt;/strong&gt;&lt;br&gt;
Promises.&lt;/p&gt;
&lt;h2&gt;
  
  
  Promise:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future.&lt;/p&gt;

&lt;p&gt;A Promise is in one of these states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pending: initial state, neither fulfilled nor rejected.&lt;/li&gt;
&lt;li&gt;fulfilled: meaning that the operation was completed successfully.&lt;/li&gt;
&lt;li&gt;rejected: meaning that the operation failed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The eventual state of a pending promise can either be fulfilled with a value or rejected with a reason (error). When either of these options occur, the associated handlers queued up by a promise's then method are called. If the promise has already been fulfilled or rejected when a corresponding handler is attached, the handler will be called, so there is no race condition between an asynchronous operation completing and its handlers being attached.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Filwg6cb2o2x642883rm8.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%2Filwg6cb2o2x642883rm8.png" alt=" " width="765" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution for callback hell using promise&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;login()
    .then(selectFood)
    .then(makePayment)
    .then(placeOrder)
    .then(deliverFood)
    .then(() =&amp;gt; {
        console.log("Enjoy your meal!");
    })
    .catch((error) =&amp;gt; {
        console.log(error);
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function tossCoin(){
    return new Promise((resolve,reject) =&amp;gt; {
        const rand = Math.floor(Math.random() * 2)
        if(rand==0)
            resolve()
        else
            reject()

    })
}
  tossCoin()
        .then(()=&amp;gt;console.log("Congrats!,Its head,You won"))
        .catch(()=&amp;gt;console.log("Sorry,You lost,Its tail"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;If it is 0 means that is heads.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Congrats!,Its head,You won
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function tossCoin(){
    return new Promise((resolve,reject) =&amp;gt; {
        const rand = Math.floor(Math.random() * 2)
        if(rand==1)
            resolve()
        else
            reject()

    })
}
  tossCoin()
        .then(()=&amp;gt;console.log("Congrats!,Its head,You won"))
        .catch(()=&amp;gt;console.log("Sorry,You lost,Its tail"))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
If it is 1 means that is tail&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sorry,You lost,Its tail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Promise concurrency
&lt;/h2&gt;

&lt;p&gt;The Promise class offers four static methods to facilitate async task concurrency:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promise.all()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fulfills when all of the promises fulfill; rejects when any of the promises rejects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promise.allSettled()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fulfills when all promises settle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promise.any()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fulfills when any of the promises fulfills; rejects when all of the promises reject.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promise.race()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Settles when any of the promises settles. In other words, fulfills when any of the promises fulfills; rejects when any of the promises rejects.&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/javascript/what-to-understand-callback-and-callback-hell-in-javascript/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/javascript/what-to-understand-callback-and-callback-hell-in-javascript/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@raihan_tazdid/callback-hell-in-javascript-all-you-need-to-know-296f7f5d3c1" rel="noopener noreferrer"&gt;https://medium.com/@raihan_tazdid/callback-hell-in-javascript-all-you-need-to-know-296f7f5d3c1&lt;/a&gt;&lt;/p&gt;

</description>
      <category>callbackhell</category>
      <category>promise</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Math functions and Searching elements</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Thu, 02 Jul 2026 18:05:12 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/math-functions-and-searching-elements-32p5</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/math-functions-and-searching-elements-32p5</guid>
      <description>&lt;h2&gt;
  
  
  The Math Object
&lt;/h2&gt;

&lt;p&gt;The JavaScript Math object allows you to perform mathematical tasks.&lt;/p&gt;

&lt;p&gt;The Math object is static.&lt;/p&gt;

&lt;p&gt;All methods and properties can be used without creating a Math object first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Math Properties (Constants)
&lt;/h2&gt;

&lt;p&gt;The syntax for any Math property is : Math.property.&lt;/p&gt;

&lt;p&gt;JavaScript provides 8 mathematical constants that can be accessed as Math properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.E        // returns Euler's number
Math.PI       // returns PI
Math.SQRT2    // returns the square root of 2
Math.SQRT1_2  // returns the square root of 1/2
Math.LN2      // returns the natural logarithm of 2
Math.LN10     // returns the natural logarithm of 10
Math.LOG2E    // returns base 2 logarithm of E
Math.LOG10E   // returns base 10 logarithm of E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Math Methods
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F82jzshzj8lvxic102wrl.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%2F82jzshzj8lvxic102wrl.png" alt=" " width="733" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Math.round()&lt;/strong&gt;&lt;br&gt;
Math.round(x) returns the nearest integer&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.round(4.6);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.ceil()&lt;/strong&gt;&lt;br&gt;
Math.ceil(x) returns the value of x rounded up to its nearest integer&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.ceil(4.9);
Math.ceil(4.7);
Math.ceil(4.4);
Math.ceil(4.2);
Math.ceil(-4.2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.floor()&lt;/strong&gt;&lt;br&gt;
Math.floor(x) returns the value of x rounded down to its nearest integer&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.floor(4.9);
Math.floor(4.7);
Math.floor(4.4);
Math.floor(4.2);
Math.floor(-4.2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.trunc()&lt;/strong&gt;&lt;br&gt;
Math.trunc(x) returns the integer part of x&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.trunc(4.9);
Math.trunc(4.7);
Math.trunc(4.4);
Math.trunc(4.2);
Math.trunc(-4.2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.sign()&lt;/strong&gt;&lt;br&gt;
Math.sign(x) returns if x is negative, null or positive.&lt;/p&gt;

&lt;p&gt;If x is positive it returns 1&lt;br&gt;
If x is negative it returns -1&lt;br&gt;
If x is zero, it returns 0&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.sign(-4);
Math.sign(0);
Math.sign(4);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.pow()&lt;/strong&gt;&lt;br&gt;
Math.pow(x, y) returns the value of x to the power of y&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.pow(8, 2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.sqrt()&lt;/strong&gt;&lt;br&gt;
Math.sqrt(x) returns the square root of x&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.sqrt(64);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.abs()&lt;/strong&gt;&lt;br&gt;
Math.abs(x) returns the absolute (positive) value of x&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.abs(-4.7);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.min() and Math.max()&lt;/strong&gt;&lt;br&gt;
Math.min() and Math.max() can be used to find the lowest or highest value in a list of arguments&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.min(0, 150, 30, 20, -8, -200);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.max(0, 150, 30, 20, -8, -200);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Math.random()&lt;/strong&gt;&lt;br&gt;
Math.random() returns a random number between 0 (inclusive), and 1 (exclusive)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.random();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Finding HTML Elements
&lt;/h2&gt;

&lt;p&gt;Often, with JavaScript, you want to manipulate HTML elements.&lt;/p&gt;

&lt;p&gt;To do so, you have to find the elements first. There are several ways to do this:&lt;/p&gt;

&lt;p&gt;Finding HTML elements by id&lt;br&gt;
Finding HTML elements by tag name&lt;br&gt;
Finding HTML elements by class name&lt;br&gt;
Finding HTML elements by CSS selectors&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding HTML Element by Id&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The easiest way to find an HTML element in the DOM, is by using the element id.&lt;/p&gt;

&lt;p&gt;This example finds the element with id="intro"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = document.getElementById("intro");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the element is found, the method will return the element as an object (in element).&lt;/p&gt;

&lt;p&gt;If the element is not found, element will contain null.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding HTML Elements by Tag Name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This example finds all &lt;/p&gt;
&lt;p&gt; elements&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = document.getElementsByTagName("p");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example finds the element with id="main", and then finds all &lt;/p&gt;
&lt;p&gt; elements inside "main"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x = document.getElementById("main");
const y = x.getElementsByTagName("p");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Finding HTML Elements by Class Name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to find all HTML elements with the same class name, use getElementsByClassName().&lt;/p&gt;

&lt;p&gt;This example returns a list of all elements with class="intro".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x = document.getElementsByClassName("intro");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Finding HTML Elements by CSS Selectors
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The querySelector() Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Document method querySelector() returns the first Element within the document that matches the specified CSS selector, or group of CSS selectors. If no matches are found, null is returned.&lt;/p&gt;

&lt;p&gt;The matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes.&lt;/p&gt;

&lt;p&gt;If the specified selector matches an ID that is incorrectly used more than once in the document, the first element with that ID is returned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;selectors&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A string containing one or more selectors to match. This string must be a valid CSS selector string; if it isn't, a SyntaxError exception is thrown.&lt;/p&gt;

&lt;p&gt;Note that the HTML specification does not require attribute values to be valid CSS identifiers. If a class or id attribute value is not a valid CSS identifier, then you must escape it before using it in a selector, either by calling CSS.escape() on the value, or using one of the techniques described in Escaping characters. See Escaping attribute values for an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;p class="demo"&amp;gt;&amp;lt;/p&amp;gt;

&amp;lt;script&amp;gt;
// Access a paragraph Element
const myPara = document.querySelector(".demo");

// Change the content of the Element
myPara.innerHTML = "Hello World!";
&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The querySelectorAll() Method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Document method querySelectorAll() returns a static (not live) NodeList representing a list of the document's elements that match the specified group of selectors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;selectors&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A string containing one or more selectors to match. This string must be a valid CSS selector string; if it isn't, a SyntaxError exception is thrown.&lt;/p&gt;

&lt;p&gt;Note that the HTML specification does not require attribute values to be valid CSS identifiers. If a class or id attribute value is not a valid CSS identifier, then you must escape it before using it in a selector, either by calling CSS.escape() on the value, or using one of the techniques described in Escaping characters. See Escaping attribute values for an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;p class="demo"&amp;gt;One&amp;lt;/p&amp;gt;
&amp;lt;p class="demo"&amp;gt;Two&amp;lt;/p&amp;gt;

&amp;lt;script&amp;gt;
// Access a paragraph Element
const myItems = document.querySelectorAll(".demo");

// Change the content of the Element
myItems[0].innerHTML = "First";
&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to find all HTML elements that match a specified CSS selector (id, class names, types, attributes, values of attributes, etc), use the querySelectorAll() method.&lt;/p&gt;

&lt;p&gt;This example returns a list of all &lt;/p&gt;
&lt;p&gt; elements with class="intro".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Mistakes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;#&lt;/code&gt; in getElementById():&lt;br&gt;
  Wrong: "#demo"&lt;br&gt;
Forgetting that querySelector() returns only the first match&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/Js/js_htmldom_elements.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/Js/js_htmldom_elements.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/jS/js_math.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/jS/js_math.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Software Development Life Cycle</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Tue, 30 Jun 2026 17:22:22 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/software-development-life-cycle-cm1</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/software-development-life-cycle-cm1</guid>
      <description>&lt;p&gt;Today, I attended a training session on &lt;strong&gt;Software Development Life Cycle (SDLC).&lt;/strong&gt; In this I learned about the SDLC, Phases of SDLC how it works in the projects and Companies with an example. Then experienced persons who are in the session they also shares their knowledge about this SDLC. That was a new thing for myself to gathering these type knowledge and information from them. In this session happens like interactive, differents opinions about the SDLC and informative things and discuss about the BRS(Business Requirements Specification),FRS(Functional Requirements Specification),SRS(Software Requirements Specification).This fully concentrate from requirements from client to develop final project based on their requirements complete the projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  SDLC:
&lt;/h2&gt;

&lt;p&gt;The software development lifecycle (SDLC) is the cost-effective and time-efficient process that development teams use to design and build high-quality software. The goal of SDLC is to minimize project risks through forward planning so that software meets customer expectations during production and beyond. This methodology outlines a series of steps that divide the software development process into tasks you can assign, complete, and measure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importance of SDLC:
&lt;/h2&gt;

&lt;p&gt;Software development can be challenging to manage due to changing requirements, technology upgrades, and cross-functional collaboration. The software development lifecycle (SDLC) methodology provides a systematic management framework with specific deliverables at every stage of the software development process. As a result, all stakeholders agree on software development goals and requirements upfront and also have a plan to achieve those goals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are some benefits of SDLC:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased visibility of the development process for all stakeholders involved&lt;/li&gt;
&lt;li&gt;Efficient estimation, planning, and scheduling&lt;/li&gt;
&lt;li&gt;Improved risk management and cost estimation&lt;/li&gt;
&lt;li&gt;Systematic software delivery and better customer satisfaction&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SDLC works:
&lt;/h2&gt;

&lt;p&gt;The software development lifecycle (SDLC) outlines several tasks required to build a software application. The development process goes through several stages as developers add new features and fix bugs in the software.&lt;/p&gt;

&lt;p&gt;The details of the SDLC process vary for different teams. However, we outline some common SDLC phases below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phases of SDLC&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Planning&lt;/li&gt;
&lt;li&gt;Design&lt;/li&gt;
&lt;li&gt;Development&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Deployment&lt;/li&gt;
&lt;li&gt;Maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Planning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The planning phase typically includes tasks like cost-benefit analysis, scheduling, resource estimation, and allocation. The development team collects requirements from several stakeholders such as customers, internal and external experts, and managers to create a software requirement specification document.&lt;/p&gt;

&lt;p&gt;The document sets expectations and defines common goals that aid in project planning. The team estimates costs, creates a schedule, and has a detailed plan to achieve their goals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the design phase, software engineers analyze requirements and identify the best solutions to create the software. For example, they may consider integrating pre-existing modules, make technology choices, and identify development tools. They will look at how to best integrate the new software into any existing IT infrastructure the organization may have.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the implementation phase, the development team codes the product. They analyze the requirements to identify smaller coding tasks they can do daily to achieve the final result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The development team combines automation and manual testing to check the software for bugs. Quality analysis includes testing the software for errors and checking if it meets customer requirements. Because many teams immediately test the code they write, the testing phase often runs parallel to the development phase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When teams develop software, they code and test on a different copy of the software than the one that the users have access to. The software that customers use is called production, while other copies are said to be in the build environment, or testing environment.&lt;/p&gt;

&lt;p&gt;Having separate build and production environments ensures that customers can continue to use the software even while it is being changed or upgraded. The deployment phase includes several tasks to move the latest build copy to the production environment, such as packaging, environment configuration, and installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the maintenance phase, among other tasks, the team fixes bugs, resolves customer issues, and manages software changes. In addition, the team monitors overall system performance, security, and user experience to identify new ways to improve the existing software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-time example:
&lt;/h2&gt;

&lt;p&gt;"For example, if a client wants to build a food delivery application, the team first gathers all the requirements, such as user registration, restaurant search, cart, payment, and order tracking. Next, the project manager plans the budget, timeline, and team. Then, designers create the UI and database design. Developers write the frontend and backend code based on the design. After development, testers verify all features and report any bugs, which developers fix. Once the application passes testing, it is deployed by devops team to the production server so users can access it. Finally, during the maintenance phase, developers fix issues, improve performance, and add new features based on user feedback."&lt;/p&gt;

&lt;h2&gt;
  
  
  SDLC models: (TBD)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Waterfall&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The waterfall model arranges all the phases sequentially so that each new phase depends on the outcome of the previous phase. Conceptually, the design flows from one phase down to the next, like that of a waterfall.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pros and cons:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The waterfall model provides discipline to project management and gives a tangible output at the end of each phase. However, there is little room for change once a phase is considered complete, as changes can affect the software's delivery time, cost, and quality. Therefore, the model is most suitable for small software development projects, where tasks are easy to arrange and manage and requirements can be pre-defined accurately.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Iterative:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The iterative process suggests that teams begin software development with a small subset of requirements. Then, they iteratively enhance versions over time until the complete software is ready for production. The team produces a new software version at the end of each iteration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pros and cons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s easy to identify and manage risks, as requirements can change between iterations. However, repeated cycles could lead to scope change and underestimation of resources.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Spiral:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The spiral model combines the iterative model's small repeated cycles with the waterfall model's linear sequential flow to prioritize risk analysis. You can use the spiral model to ensure software's gradual release and improvement by building prototypes at each phase.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pros and cons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The spiral model is suitable for large and complex projects that require frequent changes. However, it can be expensive for smaller projects with a limited scope.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Agile:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agile model arranges the SDLC phases into several development cycles. The team iterates through the phases rapidly, delivering only small, incremental software changes in each cycle. They continuously evaluate requirements, plans, and results so that they can respond quickly to change. The agile model is both iterative and incremental, making it more efficient than other process models.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pros and cons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rapid development cycles help teams identify and address issues in complex projects early on and before they become significant problems. They can also engage customers and stakeholders to obtain feedback throughout the project lifecycle. However, overreliance on customer feedback could lead to excessive scope changes or end the project midway.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;RAD Model:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The RAD (Rapid Application Development) Model is a software development methodology that focuses on fast development and frequent releases of working software. It emphasizes iterative development, quick user feedback, and flexibility, allowing changes to be easily incorporated during the development process. Unlike traditional models such as the Waterfall Model, RAD adapts quickly to changing requirements and user needs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pros and cons&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The RAD model enables faster development, early customer feedback, better quality, easy progress tracking, and flexibility to accommodate changing requirements. It requires skilled developers, reusable components, continuous customer involvement, and strong team coordination. It is also not suitable for every project and can be expensive for small applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  DevOps and the SDLC:
&lt;/h2&gt;

&lt;p&gt;DevOps is a software development methodology that combines and automates the work of both software development and IT operations teams. The DevOps lifecycle has its own steps, which are similar to the steps of the SDLC. But DevOps reconfigures the steps of the SDLC to create a continuous cycle for software development and improvement.&lt;/p&gt;

&lt;p&gt;The core principles of a DevOps approach are collaboration, automation and continuous integration and continuous delivery (CI/CD). Because DevOps addresses the full software development process, it might be considered a software development lifecycle in its own right. &lt;/p&gt;

&lt;p&gt;But DevOps is also larger than this, encompassing a cultural and organizational shift toward shared responsibility and collaboration. Crucially, DevOps is not a single model, but a combination of practices, tools and cultural philosophies.&lt;/p&gt;

&lt;p&gt;DevOps addresses the rigidity of the SDLC by making each phase of the software development process continuous throughout the project. Instead of being limited to discrete steps, planning, coding, testing, deploying, maintaining and monitoring all continue throughout a product’s lifecycle. The result is a continuous delivery pipeline in which software is improved through frequent updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  DevSecOps and the SDLC:
&lt;/h2&gt;

&lt;p&gt;DevSecOps, sometimes called “secure DevOps,” integrates automated security testing and security practices into the DevOps model. Where traditional software development treats security testing as its own phase, DevSecOps incorporates security considerations into every phase of the SDLC.&lt;/p&gt;

&lt;p&gt;By threading security tests such as code reviews and penetration testing throughout the development lifecycle, teams can avoid some delays arising from factors such as vulnerabilities that are identified late in the process. They can address risk management issues earlier, create more secure programs, accelerate vulnerability remediation and deliver more cost-effective software. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj9ku9nxdow4092efus0h.webp" 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%2Fj9ku9nxdow4092efus0h.webp" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Bounty:
&lt;/h2&gt;

&lt;p&gt;A bug bounty program is a security program where companies reward ethical hackers for finding and reporting security vulnerabilities before attackers can exploit them. This helps organizations improve application security and protect user data.&lt;/p&gt;

&lt;p&gt;Bug bounty programs reward ethical hackers who identify and responsibly disclose vulnerabilities to the application’s developer, before attackers can exploit them. By engaging a diverse, global community of experts, organizations continuously monitor and test their attack surface, uncover hard-to-find vulnerabilities, reduce risk, and build customer trust. Bug bounty programs allow companies to leverage the hacker community to improve their systems’ security posture over time.&lt;/p&gt;

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

&lt;p&gt;The above defined topics are i learned from my session and now i study above the SDLC and how its works. This session is helped me understand that &lt;u&gt;successful software development is not just about writing code—it requires proper planning, collaboration, documentation, testing, and continuous improvement.&lt;/u&gt;&lt;strong&gt;Overall these are my today learning about the SDLC to experience the learning is strengthened my knowledge of software development processes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwqmofwukbgh4mgfxjijw.jpg" 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%2Fwqmofwukbgh4mgfxjijw.jpg" alt=" " width="800" height="1080"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bs5fxdultrjpse3dndf.jpg" 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%2F8bs5fxdultrjpse3dndf.jpg" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl73uegtoxdqbib0o9bhi.jpg" 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%2Fl73uegtoxdqbib0o9bhi.jpg" alt=" " width="800" height="658"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;The images above are my handwritten notes taken during the live SDLC training session. I referred to these notes while writing this blog to summarize what I learned and to document my understanding of the concepts discussed during the session.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/what-is/sdlc/" rel="noopener noreferrer"&gt;https://aws.amazon.com/what-is/sdlc/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/software-engineering/software-development-life-cycle-sdlc/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/software-engineering/software-development-life-cycle-sdlc/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/software-engineering/software-engineering-rapid-application-development-model-rad/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/software-engineering/software-engineering-rapid-application-development-model-rad/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.hackerone.com/bug-bounty-programs" rel="noopener noreferrer"&gt;https://www.hackerone.com/bug-bounty-programs&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Javascript DOM mini projects</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Mon, 29 Jun 2026 16:54:42 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/javascript-dom-mini-projects-5g02</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/javascript-dom-mini-projects-5g02</guid>
      <description>&lt;h2&gt;
  
  
  My JavaScript Practice Journey: 5 Beginner-Friendly DOM Projects
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As part of my JavaScript learning journey, I completed five beginner-friendly projects that helped me understand the fundamentals of DOM manipulation, event handling, functions, and user interaction. These projects allowed me to apply JavaScript concepts in practical scenarios and build confidence in creating interactive web applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technologies Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTML5&lt;/li&gt;
&lt;li&gt;CSS3&lt;/li&gt;
&lt;li&gt;JavaScript (ES6)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  1. Change Text by Clicking a Button
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;This project changes the text of a heading or paragraph whenever the user clicks a button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts Practiced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getElementById()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;onclick&lt;/code&gt; Event&lt;/li&gt;
&lt;li&gt;&lt;code&gt;innerText&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Selecting HTML elements using JavaScript.&lt;/li&gt;
&lt;li&gt;Updating text dynamically.&lt;/li&gt;
&lt;li&gt;Handling button click events.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CODE:
&lt;/h2&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;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Kamalesh😎&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Click the button to change text&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"changename()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Change Text&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;changename&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Kamalesh😎&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Vignesh🐒&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="k"&gt;else&lt;/span&gt;&lt;span class="p"&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Kamalesh😎&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="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Text before change:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv5mohmt3pa3vev5xrh7l.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%2Fv5mohmt3pa3vev5xrh7l.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Text after change:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm9euqcke13nhdgn3c1cs.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%2Fm9euqcke13nhdgn3c1cs.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitlab&lt;/strong&gt;--&amp;gt; &lt;a href="https://learn-html-and-css-1da177.gitlab.io/javascript/textchange.html" rel="noopener noreferrer"&gt;https://learn-html-and-css-1da177.gitlab.io/javascript/textchange.html&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Light On/Off Toggle
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;In this project, I created a light bulb switch. Clicking the buttons changes the bulb image between ON and OFF states.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts Practiced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;Image Manipulation&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src&lt;/code&gt; Attribute&lt;/li&gt;
&lt;li&gt;Button Events&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;How to change image sources dynamically.&lt;/li&gt;
&lt;li&gt;Creating interactive visual effects.&lt;/li&gt;
&lt;li&gt;Understanding how JavaScript controls HTML elements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CODE:
&lt;/h2&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;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"bulb"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"bulb light.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"img is not here"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"on()"&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;ON&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;bulb&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bulb&lt;/span&gt;&lt;span class="dl"&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;btn&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;getElementById&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ON&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="nx"&gt;bulb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bulb2.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;OFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;firebrick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;border&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2px solid rgb(98, 18, 18)&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="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;bulb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bulb light.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ON&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                 &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgb(94, 178, 34)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;border&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2px solid rgb(31, 98, 18)&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="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before light ON&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5nwozfuu7iugrvjwckmh.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%2F5nwozfuu7iugrvjwckmh.png" alt=" " width="706" height="810"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After light ON&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1idrwu4xx4h66x3jt4p4.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%2F1idrwu4xx4h66x3jt4p4.png" alt=" " width="722" height="847"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitlab&lt;/strong&gt;--&amp;gt; &lt;a href="https://learn-html-and-css-1da177.gitlab.io/javascript/light.html" rel="noopener noreferrer"&gt;https://learn-html-and-css-1da177.gitlab.io/javascript/light.html&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Counter App
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;The Counter App increases, decreases, or resets a number using different buttons.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts Practiced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Arithmetic Operators&lt;/li&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;Button Click Events&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Updating values dynamically.&lt;/li&gt;
&lt;li&gt;Using variables to store data.&lt;/li&gt;
&lt;li&gt;Performing mathematical operations with JavaScript.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CODE:
&lt;/h2&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;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Counter App&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"core"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&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;"sub"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"sub()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;-&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"counter"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&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;"add"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"add()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;+&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&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;"reset"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"reset()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Reset&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;counts&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&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="nx"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&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="nx"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
            &lt;span class="k"&gt;if&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;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&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="nx"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;reset&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="o"&gt;=&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="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F56fbmuybymtrt06ww028.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%2F56fbmuybymtrt06ww028.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitlab&lt;/strong&gt;--&amp;gt; &lt;a href="https://learn-html-and-css-1da177.gitlab.io/javascript/counterapp.html" rel="noopener noreferrer"&gt;https://learn-html-and-css-1da177.gitlab.io/javascript/counterapp.html&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Live Character Counter
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;The Live Character Counter displays the number of characters entered into a textarea in real time. Every time the user types, deletes, or pastes text, the count updates automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts Practiced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getElementById()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;oninput&lt;/code&gt; Event&lt;/li&gt;
&lt;li&gt;&lt;code&gt;value&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;length&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;innerText&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Responding to user input instantly.&lt;/li&gt;
&lt;li&gt;Counting characters using the &lt;code&gt;length&lt;/code&gt; property.&lt;/li&gt;
&lt;li&gt;Updating webpage content dynamically.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CODE:
&lt;/h2&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;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Live Character Count&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Enter your text here"&lt;/span&gt; &lt;span class="na"&gt;oninput=&lt;/span&gt;&lt;span class="s"&gt;"countCharacters()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Count characters:&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"count"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;textarea&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&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;counts&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;count&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;countCharacters&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="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;textarea&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&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;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffvnokag8v6exwtjnfaqc.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%2Ffvnokag8v6exwtjnfaqc.png" alt=" " width="799" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitlab&lt;/strong&gt;--&amp;gt; &lt;a href="https://learn-html-and-css-1da177.gitlab.io/javascript/charactercount.html" rel="noopener noreferrer"&gt;https://learn-html-and-css-1da177.gitlab.io/javascript/charactercount.html&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Show/Hide Password
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Overview
&lt;/h3&gt;

&lt;p&gt;This project allows users to show or hide the password entered in an input field. Clicking the button toggles the password visibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts Practiced
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Conditional Statements (&lt;code&gt;if...else&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Input &lt;code&gt;type&lt;/code&gt; Property&lt;/li&gt;
&lt;li&gt;&lt;code&gt;innerText&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Button Events&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Changing element properties dynamically.&lt;/li&gt;
&lt;li&gt;Using conditional statements effectively.&lt;/li&gt;
&lt;li&gt;Improving user experience with interactive features.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CODE:
&lt;/h2&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;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Show and Hide Password&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"password"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"password"&lt;/span&gt; &lt;span class="na"&gt;placeholder=&lt;/span&gt;&lt;span class="s"&gt;"Enter Password"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

        &lt;span class="c"&gt;&amp;lt;!-- &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; --&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"Password()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Show&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;


    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;password&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;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Password&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&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="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&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="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&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="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hide Password:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx7o28ter8kqtft2g6a2y.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%2Fx7o28ter8kqtft2g6a2y.png" alt=" " width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show Password:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fggm9agdbh9p5v39m31nl.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%2Fggm9agdbh9p5v39m31nl.png" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gitlab&lt;/strong&gt;--&amp;gt; &lt;a href="https://learn-html-and-css-1da177.gitlab.io/javascript/hidePassword.html" rel="noopener noreferrer"&gt;https://learn-html-and-css-1da177.gitlab.io/javascript/hidePassword.html&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  JavaScript Concepts I Practiced
&lt;/h1&gt;

&lt;p&gt;These projects helped me strengthen my understanding of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables (&lt;code&gt;let&lt;/code&gt;, &lt;code&gt;const&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;DOM Manipulation&lt;/li&gt;
&lt;li&gt;Event Handling&lt;/li&gt;
&lt;li&gt;Conditional Statements&lt;/li&gt;
&lt;li&gt;&lt;code&gt;getElementById()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;innerText&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;value&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;length&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Input &lt;code&gt;type&lt;/code&gt; Property&lt;/li&gt;
&lt;li&gt;Image &lt;code&gt;src&lt;/code&gt; Property&lt;/li&gt;
&lt;li&gt;Arithmetic Operators&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Skills Improved
&lt;/h1&gt;

&lt;p&gt;By completing these projects, I improved my ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build interactive web pages.&lt;/li&gt;
&lt;li&gt;Connect HTML, CSS, and JavaScript.&lt;/li&gt;
&lt;li&gt;Write clean and reusable JavaScript functions.&lt;/li&gt;
&lt;li&gt;Understand how user actions trigger JavaScript events.&lt;/li&gt;
&lt;li&gt;Solve simple programming problems using DOM manipulation.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;These five beginner projects have given me a strong foundation in JavaScript and front-end development. Each project introduced a new concept while reinforcing previous topics, making the learning process understandable and practicable.&lt;/p&gt;

&lt;p&gt;I will continue building more JavaScript projects to improve my problem-solving skills, deepen my understanding of the DOM, and prepare myself for real-world web development and technical interviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Projects Completed:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change Text by Clicking a Button&lt;/li&gt;
&lt;li&gt;Light On/Off Toggle&lt;/li&gt;
&lt;li&gt;Counter App&lt;/li&gt;
&lt;li&gt;Live Character Counter&lt;/li&gt;
&lt;li&gt;Show/Hide Password&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every project is another step toward becoming a better JavaScript developer. More projects coming soon!&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/tools/tool_char_counter.php" rel="noopener noreferrer"&gt;https://www.w3schools.com/tools/tool_char_counter.php&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>DOM</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Sun, 28 Jun 2026 10:26:32 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/dom-bib</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/dom-bib</guid>
      <description>&lt;h2&gt;
  
  
  Definition of DOM:
&lt;/h2&gt;

&lt;p&gt;The Document Object Model (DOM) connects web pages to scripts or programming languages by representing the structure of a document such as the HTML representing a web page—in memory. Usually it refers to JavaScript, even though modeling HTML, SVG, or XML documents as objects are not part of the core JavaScript language.&lt;/p&gt;

&lt;p&gt;The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree. With them, you can change the document's structure, style, or content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1q6tvmt8cmp52sy6mtty.jpg" 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%2F1q6tvmt8cmp52sy6mtty.jpg" alt=" " width="290" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nodes can also have event handlers attached to them. Once an event is triggered, the event handlers get executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concepts and usage:
&lt;/h2&gt;

&lt;p&gt;The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.&lt;/p&gt;

&lt;p&gt;A web page is a document that can be either displayed in the browser window or as the HTML source. In both cases, it is the same document but the Document Object Model (DOM) representation allows it to be manipulated. As an object-oriented representation of the web page, it can be modified with a scripting language such as JavaScript.&lt;/p&gt;

&lt;p&gt;DOM stands for Document Object Model. It is an interface that allows JavaScript to access and manipulate HTML elements dynamically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example : Change Text
&lt;/h2&gt;

&lt;p&gt;HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 id="title"&amp;gt;Hello&amp;lt;/h1&amp;gt;

&amp;lt;button onclick="changeText()"&amp;gt;
Change
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function changeText() {
    document.getElementById("title").innerHTML = "Welcome!";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before clicking&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After clicking&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  getElementById()
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;getElementById() is a DOM method used to find and access an HTML element by its id.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;getElementById() is a DOM method that returns the HTML element whose id matches the given value.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("idName");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;document → Represents the entire HTML page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;getElementById() → Searches for an element by its id.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"idName" → The value of the id attribute in the HTML.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;getElementById() is a DOM method that selects a single HTML element using its unique id. It returns the element object, allowing JavaScript to read or modify its content, style, or attributes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember: getElementById() only finds the element. What you do after finding it (such as changing innerHTML, style, or value) determines the action performed on that element.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  innerText
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;innerText is a DOM property used to get or set the visible text inside an HTML element.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;innerText is a property that returns or changes the visible text content of an HTML element.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Syntax
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;element.innerText = "New Text";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example 1: Get Text&lt;/strong&gt;&lt;br&gt;
HTML&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 id="title"&amp;gt;Hello World&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = document.getElementById("title").innerText;

console.log(text);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Here document.getElementById("title") → Finds the &lt;/p&gt;
&lt;h1&gt; element.&lt;/h1&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;.innerText → Reads the visible text inside it.&lt;br&gt;
&lt;strong&gt;Example 2: Change Text&lt;/strong&gt;&lt;br&gt;
HTML&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 id="title"&amp;gt;Hello&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById("title").innerText = "Welcome";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;innerText → Reads or changes the visible text inside that element.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/js/js_htmldom.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/js_htmldom.asp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/html/javascript-html-dom/" rel="noopener noreferrer"&gt;https://www.geeksforgeeks.org/html/javascript-html-dom/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dom</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Array Search Methods in JavaScript</title>
      <dc:creator>Kamalesh AR</dc:creator>
      <pubDate>Thu, 25 Jun 2026 17:28:25 +0000</pubDate>
      <link>https://dev.to/kamalesh_ar_6252544786997/array-search-methods-in-javascript-23mk</link>
      <guid>https://dev.to/kamalesh_ar_6252544786997/array-search-methods-in-javascript-23mk</guid>
      <description>&lt;p&gt;Array Search Methods are built-in JavaScript methods used to search for elements in an array. They help us check whether an element exists, find its position (index), or retrieve elements that satisfy a condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. indexOf()
&lt;/h2&gt;

&lt;p&gt;Returns the first index of the specified element. If the element is not found, it returns -1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&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;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mango&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&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;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&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;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. lastIndexOf()
&lt;/h2&gt;

&lt;p&gt;Returns the last index of the specified element. If not found, it returns -1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mango&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&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;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lastIndexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&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;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. includes()
&lt;/h2&gt;

&lt;p&gt;Checks whether an element exists in an array. It returns true or false.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mango&lt;/span&gt;&lt;span class="dl"&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;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mango&lt;/span&gt;&lt;span class="dl"&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;fruits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Orange&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;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. find()
&lt;/h2&gt;

&lt;p&gt;Returns the first element that satisfies the given condition. If no element matches, it returns undefined.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&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="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&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;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5 &amp;gt; 10 (Wrong)&lt;/li&gt;
&lt;li&gt;12 &amp;gt; 10  → Stops and returns 12 (correct)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. findIndex()
&lt;/h2&gt;

&lt;p&gt;Returns the index of the first element that satisfies the condition. If none match, it returns -1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&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;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&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;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. findLast()
&lt;/h2&gt;

&lt;p&gt;Returns the last element that satisfies the given condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findLast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&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;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Search starts from the end:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;20 &amp;gt; 10 → Returns 20&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. findLastIndex()
&lt;/h2&gt;

&lt;p&gt;Returns the index of the last element that satisfies the condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&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;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findLastIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&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;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Easy Way to Remember
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;indexOf() → First index of a value.&lt;/li&gt;
&lt;li&gt;lastIndexOf() → Last index of a value.&lt;/li&gt;
&lt;li&gt;includes() → Checks if a value exists.&lt;/li&gt;
&lt;li&gt;find() → First element matching a condition.&lt;/li&gt;
&lt;li&gt;findIndex() → Index of the first matching element.&lt;/li&gt;
&lt;li&gt;findLast() → Last element matching a condition.&lt;/li&gt;
&lt;li&gt;findLastIndex() → Index of the last matching element.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reference:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.w3schools.com/js/js_array_search.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/js/js_array_search.asp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>search</category>
      <category>learning</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
