<?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>Forem: Md. Injamul Alam</title>
    <description>The latest articles on Forem by Md. Injamul Alam (@injamulcse15).</description>
    <link>https://forem.com/injamulcse15</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F689857%2F64d14029-7c42-4a14-ac7b-e05e644feb0d.jpg</url>
      <title>Forem: Md. Injamul Alam</title>
      <link>https://forem.com/injamulcse15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/injamulcse15"/>
    <language>en</language>
    <item>
      <title>Why Fresh is the "Coolest" New Framework for Web Developers</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Tue, 10 Mar 2026 21:34:10 +0000</pubDate>
      <link>https://forem.com/injamulcse15/why-fresh-is-the-coolest-new-framework-for-web-developers-15jd</link>
      <guid>https://forem.com/injamulcse15/why-fresh-is-the-coolest-new-framework-for-web-developers-15jd</guid>
      <description>&lt;p&gt;If you’ve been in the web development world for a while, you’ve probably heard of &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Vue&lt;/strong&gt;, or &lt;strong&gt;Angular&lt;/strong&gt;. They are great, but they often make websites feel "heavy" because they send a lot of JavaScript to the browser.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Fresh&lt;/strong&gt; — a modern web framework built for &lt;strong&gt;Deno&lt;/strong&gt; that is changing the game.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is Fresh?
&lt;/h4&gt;

&lt;p&gt;Fresh is a "&lt;strong&gt;full-stack&lt;/strong&gt;" framework. This means it handles both the UI (Frontend) and the Data (Backend). It’s built on top of &lt;strong&gt;Preact&lt;/strong&gt; (a tiny version of React), so if you know React, you’ll feel right at home!&lt;/p&gt;

&lt;h4&gt;
  
  
  3 Reasons Why Beginners Love Fresh
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. It’s Fast (Like, Really Fast)&lt;/strong&gt; ⚡&lt;br&gt;
Most frameworks send a big "bundle" of JavaScript to your browser before the page even loads. Fresh sends zero JavaScript by default. It only sends HTML. This makes your site load almost instantly, even on slow mobile data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. No "Build" Step&lt;/strong&gt; 🛠️&lt;br&gt;
In React or Next.js, you usually have to wait for a "build" process to finish before you can see your site. In Fresh, there is no build step. You write code, you save it, and it’s live. This makes the developer experience very smooth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The "Islands" Concept&lt;/strong&gt; 🏝️&lt;br&gt;
Imagine your website is a big ocean of static HTML (fast and light). Now, imagine you need a small interactive part, like a "Login Button" or a "Counter."&lt;br&gt;
Fresh lets you create small &lt;strong&gt;Islands of Interactivity&lt;/strong&gt;. Only these small islands use JavaScript, while the rest of the page stays light.&lt;/p&gt;
&lt;h4&gt;
  
  
  How is it different from Node.js?
&lt;/h4&gt;

&lt;p&gt;Fresh runs on &lt;strong&gt;Deno&lt;/strong&gt;, not Node.js. Deno is created by the same person who made Node.js, but it’s more secure and modern. You don’t even need a &lt;code&gt;package.json&lt;/code&gt; file!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's See Some Code!&lt;/strong&gt;&lt;br&gt;
Creating a simple counter in Fresh looks exactly like React:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//TypeScript:&lt;/span&gt;
&lt;span class="c1"&gt;// islands/Counter.tsx&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;useSignal&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;@preact/signals&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Counter&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;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSignal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Count: &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Increment&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;/&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;Should you learn it?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Yes, if you want to build super fast SEO-friendly websites (like blogs or landing pages).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Yes, if you want to explore the future of the web beyond Node.js.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Fresh is fresh! It simplifies web development by removing the heavy parts we've grown used to. If you want a framework that is easy to start, incredibly fast, and fun to use, give Fresh a try.&lt;/p&gt;

&lt;p&gt;Check it out here: &lt;a href="https://fresh.deno.dev/" rel="noopener noreferrer"&gt;fresh.deno.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>deno</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to generate an APK and an AAB file on a .NET 8 MAUI app and publish on the Google Play Store</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Fri, 26 Sep 2025 18:07:35 +0000</pubDate>
      <link>https://forem.com/injamulcse15/how-to-generate-an-apk-and-an-aab-file-on-a-net-8-maui-app-and-publish-on-the-google-play-store-1igl</link>
      <guid>https://forem.com/injamulcse15/how-to-generate-an-apk-and-an-aab-file-on-a-net-8-maui-app-and-publish-on-the-google-play-store-1igl</guid>
      <description>&lt;p&gt;Getting started with.NET8 MAUI was both exciting and challenging for me. This was my very first time working with the technology, and honestly, I had no prior experience with it. While trying to build and publish my first app, I encountered several unexpected issues and learning curves.&lt;/p&gt;

&lt;p&gt;That’s why I decided to write this blog—so if you’re also starting your first .NET 8 MAUI project, you can learn from my journey and (hopefully) avoid some of the struggles I went through.&lt;br&gt;
I want to express my gratitude to my teammates for their invaluable support and collaboration throughout this project.&lt;br&gt;
In compliance with the client's privacy policy, I am not sharing detailed information about the app's interface, name, or description.&lt;br&gt;
I will begin by explaining how to generate an APK, followed by a detailed guide on generating an AAB file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s important to note that before creating an APK or AAB file, you need to generate a secret key. This key is essential for publishing your app, as any future updates must be signed with the same key. Therefore, it’s crucial to store this key securely.&lt;br&gt;
Below, I’m providing the command-line instructions and a video tutorial showing exactly how to generate the key:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Command Line:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;keytool -genkey -v -keystore key.keystore -alias MauiAlias -keyalg RSA -keysize 2048 -validity 10000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Video Link:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://youtu.be/jfSVb_RR7X0" rel="noopener noreferrer"&gt;How to generate secret key&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s generate the APK file to test the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is APK needed?
&lt;/h2&gt;

&lt;p&gt;An APK (Android Package) file is what lets you install and run your app on an Android device. Creating an APK lets you test your app in the real world—check its performance, spot issues, and make sure everything works before publishing it to the Play Store. Think of it as a preview version of your app in your hands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate APK File
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Build the app&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fkjmgx31zmdx2d1eog551.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.amazonaws.com%2Fuploads%2Farticles%2Fkjmgx31zmdx2d1eog551.png" alt="How to build the app" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the app properties&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fjga123pjwpmh6ld93ekg.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.amazonaws.com%2Fuploads%2Farticles%2Fjga123pjwpmh6ld93ekg.png" alt="App properties" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select APK from the options. If APK is already selected by default, there’s no need to make any changes.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2F4m6i0w0nqdjsoiw3y93s.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.amazonaws.com%2Fuploads%2Farticles%2F4m6i0w0nqdjsoiw3y93s.png" alt="Selection apk" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then save your changes and build the project again. Once the build process is complete, select Release.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2F1ib309q5079gnhbm0897.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.amazonaws.com%2Fuploads%2Farticles%2F1ib309q5079gnhbm0897.png" alt="App released" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then select Publish from the project option.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2F8sywnpytki1xo97kto2v.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.amazonaws.com%2Fuploads%2Farticles%2F8sywnpytki1xo97kto2v.png" alt="Publish app" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After completing the publish process, click the "Distribute" button.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fvdda061ym40f9dr64hkv.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.amazonaws.com%2Fuploads%2Farticles%2Fvdda061ym40f9dr64hkv.png" alt="Distribute" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click 'Ad Hoc' button.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fdi7xxub5c5b6k0uy33aq.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.amazonaws.com%2Fuploads%2Farticles%2Fdi7xxub5c5b6k0uy33aq.png" alt="Ad Hoc" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save ad hoc.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Falg9utxf1q9m88e1ll3q.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.amazonaws.com%2Fuploads%2Farticles%2Falg9utxf1q9m88e1ll3q.png" alt=" " width="800" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then insert your secret key information.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Frqcuy1h3g7mfhuiwkg7b.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.amazonaws.com%2Fuploads%2Farticles%2Frqcuy1h3g7mfhuiwkg7b.png" alt="Secrect Key info" width="575" height="744"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Save As and enter your key store password.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fgtbw3pogf6vx5vr34m4j.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.amazonaws.com%2Fuploads%2Farticles%2Fgtbw3pogf6vx5vr34m4j.png" alt="keystore password" width="524" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate AAB File
&lt;/h3&gt;

&lt;p&gt;To generate an AAB file, the process is similar to generating an APK. First, you need to select the Bundle option from the Android package options.&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.amazonaws.com%2Fuploads%2Farticles%2F3yepi0l6tfac7x613ecg.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.amazonaws.com%2Fuploads%2Farticles%2F3yepi0l6tfac7x613ecg.png" alt="AAB File option" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After making the changes, set the Target .NET Runtime to net9.0. Then, choose the option that specifies the Android framework your project targets. Make sure to select Android 15.0 (API Level 35), as the Google Play Store does not allow publishing apps with API Level 34.&lt;/li&gt;
&lt;/ul&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.amazonaws.com%2Fuploads%2Farticles%2Fzaukdxcbien6xc026y0n.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.amazonaws.com%2Fuploads%2Farticles%2Fzaukdxcbien6xc026y0n.png" alt="selecandriodverion" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, build the project and select Release for publishing. After the build is complete, navigate to the bin → .NET → Android folder, where you will find the generated AAB file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you can successfully generate your APK or AAB file, ready for publishing. Remember to keep your secret key safe, as it’s essential for signing future updates. With your app properly built and signed, you’re now one step closer to sharing it with users and bringing your project to life.&lt;/p&gt;

&lt;p&gt;If you found this guide helpful, don’t forget to share it with others who might benefit from it!&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>android</category>
      <category>maui</category>
      <category>mobile</category>
    </item>
    <item>
      <title>How to Manage Parent-Child Data Communication and Update Nested Data Structures Dynamically in Angular</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Fri, 24 Jan 2025 17:54:50 +0000</pubDate>
      <link>https://forem.com/injamulcse15/how-to-manage-parent-child-data-communication-and-update-nested-data-structures-dynamically-574j</link>
      <guid>https://forem.com/injamulcse15/how-to-manage-parent-child-data-communication-and-update-nested-data-structures-dynamically-574j</guid>
      <description>&lt;p&gt;Although this post might be lengthy, my problem may not seem like a problem to someone more experienced than me. Still, I am writing it in the hope that it might help some of you. &lt;br&gt;
I have divided this blog post into two parts. In the first part, I will discuss the coding problem I faced, making it easier for you to understand the solution. In the second part, I will explain how I solved my coding problem.&lt;br&gt;
Firstly, the tech stack for the office project includes: Angular v17, .NET Core, Microsoft SQL, and the theme: PrimeNG v17.&lt;br&gt;&lt;br&gt;
The problem I’m discussing is related to retrieving saved data to update and set it in the entry form. In this case, part of the data needs to be looped through and set to the interface. Although the data was being set correctly, it was not displaying in the dropdown. Moreover, the data was not being modified correctly; even if it was, only the last element of the array was being updated.&lt;br&gt;
&lt;em&gt;I am not sharing the full code here due to privacy reasons. Instead, I have presented the main data as sample data to make it easier for you to understand.&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;JSON Data&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;{
  "masterId": 1,
  "masterDetails": [
      {
          "masterId": 1,
          "detailsData":[
          { 
            "detailsDataId": 123,
            "subDetailsData":[
             {
              "subDetailsDataId": 133,
              // here are other properties
             },
             {
              "subDetailsDataId": 134,
              // here are other properties
             }
           ]
          }
         // here are other elements of detailsData table
        ]
      }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We know that in Angular, there are primarily two types of forms for managing and handling user input:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Template-Driven Forms&lt;/li&gt;
&lt;li&gt;Reactive Forms&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the project, we are using a Template-Driven Form.&lt;br&gt;
Here is the code:&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;div *ngFor="let d of detailsData; let i = index"&amp;gt;
  &amp;lt;p-button [label]="d.detailsDataId" icon="pi pi-plus" (click)="add(i)" /&amp;gt;
  &amp;lt;div *ngFor="let subDetailD of detailsData.subDetailsData; let c = index"&amp;gt;
    &amp;lt;div class="fromgrid grid my-1 align-items-center"&amp;gt;
      &amp;lt;div class="p-fluid col-12 md:col-6 xl:col-5 md:px-1 py-1"&amp;gt;
        &amp;lt;p-dropdown
          styleClass="w-full"
          class="w-full"
          [options]="dropDownData[detailsData.detailsDataId]"
          name="DetailsDataId"
          (ngModel)]="subDetailD.subDetailsDataId"
          optionValue="DetailsDataId"
          optionLabel="DetailsDataName"
          [filter]="true"
          filterBy="DetailsDataName"
          [showClear]="true"
          placeholder="Select"
        &amp;gt;
          &amp;lt;ng-template pTemplate="selectedItem" let-selectedOption&amp;gt;
            &amp;lt;div class="flex align-items-center gap-2"&amp;gt;
              &amp;lt;div&amp;gt;{{ selectedOption?.DetailsDataName }}&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/ng-template&amp;gt;
          &amp;lt;ng-template let-data pTemplate="item"&amp;gt;
            &amp;lt;div class="flex align-items-center gap-2"&amp;gt;
              &amp;lt;div&amp;gt;{{ data.DetailsDataName }}&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/ng-template&amp;gt;
        &amp;lt;/p-dropdown&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div class="p-fluid col-6 md:col-3 xl:col-1 md:px-1 py-1"&amp;gt;
        &amp;lt;p-button
          icon="pi pi-times"
          severity="danger"
          [outlined]="true"
          size="small"
          (click)="remove(i, c)"
        /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used &lt;code&gt;ngModel&lt;/code&gt; to set the data in the form. In this case, while looping through the data to set it in the interface, I encountered the issue. Despite making many changes to the code, no solution was found. Finally, I isolated the part of the code that was causing the problem as a child component.&lt;br&gt;
Now, I am discussing the solution:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Parent Component (.html)&lt;/em&gt;&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;&amp;lt;div *ngFor="let d of detailsData; let i = index;"&amp;gt;
&amp;lt;p-button [label]="d.detailsDataId" icon="pi pi-plus" (click)="add(i)" /&amp;gt;
// Here is the child component which is looped based on the parent component
 &amp;lt;app-child-component [data]="d" [parentIndex]="I" 
  (remove)="remove(i, $event)" /&amp;gt;  
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Parent Component (.ts)&lt;/em&gt;&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;add(index: number): void { // Add a new child component dynamically
    const newsubDetailD = { 
    name: `New Sub-Details 
    ${this.detailsData[index].subDetailsData.length + 1}` };
    this.detailsData[index].subDetailsData.push(newsubDetailD);
}

remove (index: number, childIndex: number): void { 
// Method to remove a specific child component (e.g., by index)
    this.detailsData[index].subDetailsData.splice(childIndex, 1);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Child Component (.html)&lt;/em&gt;&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;&amp;lt;div *ngIf="data"&amp;gt;
    &amp;lt;div *ngFor="let subDetailD of data.subDetailsData; let c = index"&amp;gt;
        &amp;lt;div class="fromgrid grid my-1 align-items-center"&amp;gt;
            &amp;lt;div class="p-fluid col-12 md:col-6 xl:col-5 md:px-1 py-1"&amp;gt;
                &amp;lt;p-dropdown
                styleClass="w-full"
                class="w-full"
                [options]="dropDownData[data.detailsDataId]"
                name="DetailsDataId"
                (ngModel)]="subDetailD.subDetailsDataId"
                optionValue="DetailsDataId"
                optionLabel="DetailsDataName"
                [filter]="true"
                filterBy="DetailsDataName"
                [showClear]="true"
                placeholder="Select"
                &amp;gt;
                &amp;lt;ng-template pTemplate="selectedItem" let-selectedOption&amp;gt;
                    &amp;lt;div class="flex align-items-center gap-2"&amp;gt;
                    &amp;lt;div&amp;gt;{{ selectedOption?.DetailsDataName }}&amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/ng-template&amp;gt;
                &amp;lt;ng-template let-data pTemplate="item"&amp;gt;
                    &amp;lt;div class="flex align-items-center gap-2"&amp;gt;
                    &amp;lt;div&amp;gt;{{ data.DetailsDataName }}&amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/ng-template&amp;gt;
                &amp;lt;/p-dropdown&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="p-fluid col-6 md:col-3 xl:col-1 md:px-1 py-1"&amp;gt;
                &amp;lt;p-button
                icon="pi pi-times"
                severity="danger"
                [outlined]="true"
                size="small"
                (click)="remove(i, c)"
                /&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="p-fluid col-12 md:col-6 xl:col-1 md:px-1 py-1"&amp;gt;
                &amp;lt;p-button icon="pi pi-times" (click)="remove(c)" severity="danger" [outlined]="true" size="small" pTooltip="Remove Counter" tooltipPosition="bottom" /&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;_Child Component (.ts) _&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;import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
export class childComponent implements OnInit {
  constructor() {}
  ngOnInit() {} 
  @Input() data: any; // Accept data from parent
  @Input() parentIndex: number; // The index from the parent
  @Output() remove: EventEmitter&amp;lt;number&amp;gt; = new EventEmitter&amp;lt;number&amp;gt;(); 
  // Typed as number
  remove(childIndex: number): void {
   this.remove.emit(childIndex); // Emit the childIndex to the parent
  }

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

&lt;/div&gt;



&lt;p&gt;By creating a child component, I successfully resolved the binding and looping issues that were previously causing trouble with ngModel. Sometimes, the solution lies in breaking things down into smaller, more manageable pieces. While this might seem like a simple fix to many, it was a valuable learning experience for me, and I hope it inspires others to approach similar challenges with curiosity and creativity. I'd love to hear your thoughts and insights—feel free to share them!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>primeng</category>
      <category>dotnet</category>
      <category>sqlserver</category>
    </item>
    <item>
      <title>CSS Selectors for Web developer</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Wed, 10 May 2023 17:37:03 +0000</pubDate>
      <link>https://forem.com/injamulcse15/css-selectors-for-web-dev-1k35</link>
      <guid>https://forem.com/injamulcse15/css-selectors-for-web-dev-1k35</guid>
      <description>&lt;h2&gt;
  
  
  CSS selectors
&lt;/h2&gt;

&lt;p&gt;1 Element Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h3 {
    /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 Id Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#head {
    /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 Class Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.head-title {
    /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4 Attribute Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ol[type="a"] {
  /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5 Descendant Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div .card-title {
   /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6 Universal Selectors&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* {
  /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7 Nth type of Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div:nth-of-type(2) {
  /* write your css */ 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8 Pseudo-class Selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*The syntax of pseudo-class:*
selector:pseudo-class {
  property: value;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a:hover {
  /* write your css */
}

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

&lt;/div&gt;



</description>
      <category>css</category>
      <category>webdev</category>
      <category>css3</category>
    </item>
    <item>
      <title>Loop Types in JavaScript</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Sun, 10 Jul 2022 15:25:25 +0000</pubDate>
      <link>https://forem.com/injamulcse15/loop-types-in-javascript-39jj</link>
      <guid>https://forem.com/injamulcse15/loop-types-in-javascript-39jj</guid>
      <description>&lt;h2&gt;
  
  
  In this blog I'll go through different ways of looping in JavaScript with examples:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;while&lt;/li&gt;
&lt;li&gt;forEach&lt;/li&gt;
&lt;li&gt;map&lt;/li&gt;
&lt;li&gt;do while&lt;/li&gt;
&lt;li&gt;for in&lt;/li&gt;
&lt;li&gt;for of&lt;/li&gt;
&lt;li&gt;for&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;while Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

let developer = 0;

while (developer &amp;lt; developers.length) {
    console.log(developers[developer]);
    developer++;
}

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;forEach Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

developers.forEach (developer =&amp;gt;{
    console.log(developer);
})

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;map Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

developers.map (developer =&amp;gt;{
    console.log(developer);
    return developer;
})

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;do while Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

let developer = 0
do {
    console.log(developers[developer]);
    developer++;
    }

while(developer &amp;lt; developers.length)

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;for of Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

for (const developer of developers){
    console.log(developer);
    }

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;for in Loop&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;const developers = {
    1 : 'Injamul', 
    2 : 'Saurav', 
    3 : 'Tarek', 
    4 : 'Saiful'
};

for (const key in developers) {
    console.log(developers[key]);
}

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;for Loop&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;const developers = ['Injamul', 'Saurav', 'Tarek', 'Saiful'];

for (let developer = 0; developer &amp;lt; developers.length; developer++){
    console.log(developers[developer]);
    }

/* Output: 
Injamul
Saurav
Tarek
Saiful
*/  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>loop</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Talking about JavaScript function</title>
      <dc:creator>Md. Injamul Alam</dc:creator>
      <pubDate>Tue, 14 Sep 2021 15:13:54 +0000</pubDate>
      <link>https://forem.com/injamulcse15/talking-about-javascript-function-2n9o</link>
      <guid>https://forem.com/injamulcse15/talking-about-javascript-function-2n9o</guid>
      <description>&lt;h3&gt;
  
  
  What is Function in JavaScript?
&lt;/h3&gt;

&lt;p&gt;In JavaScript, functions are defined with the &lt;em&gt;'function'&lt;/em&gt; keyword.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is an another way to define a function, called &lt;em&gt;'Arrow Function'&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Declaration a Function
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Syntax&lt;/em&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 firstFunction () {
     // Code here ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Example&lt;/em&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 firstFunction () {
     console.log('JavaScript function');
}
firstFunction();
// JavaScript function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Function Expressions
&lt;/h3&gt;

&lt;p&gt;A function expression can be stored in a variable.&lt;br&gt;
&lt;em&gt;Syntax&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let firstFunction = function () {
    // Code here ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let firstFunction = function () {
     return "JavaScript function";
}
firstFunction();
// JavaScript function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Arrow Function
&lt;/h3&gt;

&lt;p&gt;Arrow function allows a short syntax for writing function expressions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We don't need the &lt;em&gt;'function'&lt;/em&gt; keyword, the &lt;em&gt;'return'&lt;/em&gt; keyword and the &lt;em&gt;'curly'&lt;/em&gt; brackets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Syntax&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let change = (argument1, argument2) =&amp;gt; Code here ... ;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let add = (x , y) =&amp;gt; x + y; 
add(4, 6);
// Output will 10 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Function Parameters
&lt;/h3&gt;

&lt;p&gt;If you want to build a &lt;em&gt;dynamic function&lt;/em&gt; then you have to use &lt;em&gt;parameters&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters are like an &lt;em&gt;input&lt;/em&gt;. Based on your &lt;em&gt;input it gives you the output&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Syntax with example&lt;/em&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 add(x, y) {
  return (x + y);
}
add(10, 5); // Output: 15,
// Here, x is 10, y is 5.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Default Parameters
&lt;/h3&gt;

&lt;p&gt;If a function is called with &lt;em&gt;missing arguments&lt;/em&gt;, the missing values are set to &lt;em&gt;undefined&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It is better to assign a &lt;em&gt;default value&lt;/em&gt;  to the &lt;em&gt;parameter&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Syntax&lt;/em&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 myFunction (argument1 = default value) {
   // Code here ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Example&lt;/em&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 sum (x = 1, y = 1) {
    return (x + y);
}
sum(4, 6); // here x is 4, y is 6
sum(4); // here x is 4 but y is 1 (default value)
sum(); // here x is 1, y is 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>function</category>
    </item>
  </channel>
</rss>
