<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Foysal Ahammed Sami on Medium]]></title>
        <description><![CDATA[Stories by Foysal Ahammed Sami on Medium]]></description>
        <link>https://medium.com/@foysal-dev?source=rss-9732a8c42fdb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ii7RN_yHX1bApnzq231MmQ.jpeg</url>
            <title>Stories by Foysal Ahammed Sami on Medium</title>
            <link>https://medium.com/@foysal-dev?source=rss-9732a8c42fdb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 12:40:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@foysal-dev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The 48-Hour Mystery: How I Finally “Called” My Home Computer]]></title>
            <link>https://foysal-dev.medium.com/the-48-hour-mystery-how-i-finally-called-my-home-computer-68e9939e1a34?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/68e9939e1a34</guid>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[home-server]]></category>
            <category><![CDATA[ssh-tunnel]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 14:24:52 GMT</pubDate>
            <atom:updated>2026-02-17T14:24:52.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdtNfqLsFqXSCE-8V4s41w.png" /></figure><p>Every tech project has that one moment where it should take five minutes but ends up taking two days. This is the story of my battle to talk to <strong>TomTheCat</strong>, my M1 Mac server at home, while I was away. It was a journey of weird errors, invisible files, and a final boss hiding in a single letter of a file name.</p><h3>The Big Idea: A Private Tunnel</h3><p>The plan was simple. I wanted to use my laptop to “call” my home computer from anywhere in the world without making my home network vulnerable to hackers. I used a tool called a <strong>Cloudflare Tunnel</strong> — think of it like a private, underground phone line that only I have the number for.</p><p>I sat down, typed the command to connect, and expected to see my home computer’s screen. Instead, I got a cold, robotic error:</p><blockquote><em>websocket: bad handshake</em></blockquote><h3>The Bouncer at the Door</h3><p>I checked my settings. It turned out I had a “Bouncer” (security) at the door who was confused. He thought I was trying to use a web browser like Chrome, but I was actually using a professional tool for developers.</p><p>I had to go into my settings and tell the Bouncer: “Hey, when I call from my terminal, let me through without trying to show me a website.” I felt smart. I tried again.</p><blockquote><em>websocket: bad handshake</em></blockquote><p>Still blocked. The Bouncer was still holding the door shut because he didn’t recognize my “ID card.”</p><h3>The Ghost in the Machine</h3><p>Even after fixing the security, my home computer stayed silent. I looked at the “logs” (the computer’s diary) to see what was happening. <strong>Nothing.</strong> It was like my computer wasn’t even hearing the phone ring.</p><p>This was the “Ghost File” phase. I was writing my instructions in a file on my desk, but the computer was reading an old, dusty set of instructions hidden in a basement folder. It was like I was changing the recipe in my kitchen, but the chef was still using an old cookbook from the 1990s.</p><h3>The Final Boss: The Letter ‘A’</h3><p>I moved my instructions to the right basement folder. I tried again. Still, a new error popped up.</p><p>Then I saw it. The computer wasn’t looking for a file named config.yml. It was strictly looking for config.yaml. That one tiny letter <strong>&#39;a&#39;</strong> was the only thing standing between me and success. I renamed the file and held my breath.</p><h3>The Locked Internal Door</h3><p>The phone was finally ringing! But now, a new problem: Connection refused. The &quot;phone line&quot; was working, but my Mac was refusing to answer because it didn&#39;t trust a call coming from its own internal system. It was like a security guard refusing to let a delivery man in because he came through the back door instead of the front.</p><p>I made one final tweak. I told the system to stop using the “back door” address and use the Mac’s official name instead.</p><h3>Victory!</h3><p>I sat back, miles away from my home. I typed the command one last time.</p><p>A window popped up on my phone asking if it was really me. I tapped “Yes.” Suddenly, my screen transformed. I wasn’t just on my laptop anymore — I was “inside” <strong>TomTheCat</strong> at home.</p><p>The war was over. The tunnel was open. I could finally get back to work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68e9939e1a34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lara Logs 02: Bootstrap]]></title>
            <link>https://foysal-dev.medium.com/lara-logs-02-bootstrap-f353222dad68?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f353222dad68</guid>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 09:55:12 GMT</pubDate>
            <atom:updated>2026-01-30T09:55:12.611Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32tzSyVAMq5-IOd714el7A.png" /></figure><p><strong>File:</strong> bootstrap/app.php <br><strong>Context:</strong> Executed immediately after index.php requires the autoloader.</p><pre>&lt;?php<br><br>use App\Http\Middleware\HandleAppearance;<br>use App\Http\Middleware\HandleInertiaRequests;<br>use Illuminate\Foundation\Application;<br>use Illuminate\Foundation\Configuration\Exceptions;<br>use Illuminate\Foundation\Configuration\Middleware;<br>use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets;<br><br>return Application::configure(basePath: dirname(__DIR__))<br>    -&gt;withRouting(<br>        web: __DIR__.&#39;/../routes/web.php&#39;,<br>        commands: __DIR__.&#39;/../routes/console.php&#39;,<br>        health: &#39;/up&#39;,<br>    )<br>    -&gt;withMiddleware(function (Middleware $middleware): void {<br>        $middleware-&gt;encryptCookies(except: [&#39;appearance&#39;, &#39;sidebar_state&#39;]);<br><br>        $middleware-&gt;web(append: [<br>            HandleAppearance::class,<br>            HandleInertiaRequests::class,<br>            AddLinkHeadersForPreloadedAssets::class,<br>        ]);<br>    })<br>    -&gt;withExceptions(function (Exceptions $exceptions): void {<br>        //<br>    })-&gt;create();</pre><h3>Execution Flow &amp; Observations</h3><p><strong>1. Application Configuration</strong> Unlike previous Laravel versions that split configuration between Http/Kernel.php and Console/Kernel.php, this setup uses a fluent API (Application::configure) to centralize the app definition.</p><p><strong>2. Routing Definitions</strong></p><ul><li><strong>web:</strong> Registers the application’s HTTP routes intended for browser access. Automatically applies the web middleware group to all routes defined in this file. Includes essential session management, cookie encryption, and CSRF protection. In an Inertia.js context, this is where the main entry route (/) and all page-visiting routes reside.</li><li><strong>commands:</strong> Registers console commands and scheduled tasks by pointing to routes/console.php. Replaces the legacy app/Console/Kernel.php structure. Allows for defining Closure-based Artisan commands and the task schedule (cron jobs) directly in the route file, decoupling command logic from strict class hierarchies.</li><li><strong>health:</strong> Defines a dedicated, zero-configuration health check endpoint at /up. When accessed, it dispatches a DiagnosingHealth event to verify core system availability (Application, Database, Redis). Returns a lightweight 200 OK status specifically optimized for external uptime monitors (e.g., Kubernetes liveness probes, AWS Route 53) to verify availability without triggering heavy application logic.</li></ul><p><strong>3. Middleware Stack</strong></p><p><strong>Cookie Exception:</strong> encryptCookies is configured to ignore appearance and sidebar_state.</p><ul><li><em>Log:</em> These values are likely accessed directly by client-side JavaScript (e.g., checking for dark mode or collapsed sidebar) before the backend processes the request.</li></ul><p><strong>Web Group Appends:</strong></p><ul><li>HandleInertiaRequests: Confirms the architecture uses Inertia.js. The middleware is appended to the web group to ensure shared data (props) are injected into the response.</li><li>HandleAppearance: Likely a custom middleware to sync UI state between backend session and frontend cookies.</li></ul><p><strong>4. Exception Handling</strong> Currently empty in the withExceptions closure, defaulting to Laravel&#39;s standard error reporting.</p><p><strong>Output</strong> Returns the configured $app instance to index.php for handleRequest execution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f353222dad68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lara logs 01: Initialization]]></title>
            <link>https://foysal-dev.medium.com/lara-logs-01-initialization-ca6ee087fe67?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca6ee087fe67</guid>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 08:07:59 GMT</pubDate>
            <atom:updated>2026-01-30T08:07:59.804Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FhgrRiW_qBdG_lB_X8l9KA.png" /></figure><p>Every massive web application, every complex API, and every SaaS platform built with Laravel starts with a single, humble step. It doesn’t start in your Controllers, and it doesn’t start in your Routes.</p><p>It starts in a file most of us rarely touch after the initial installation: public/index.php.</p><p>In this first chapter of <strong>Lara Logs</strong>, we’re cracking open the hood to see exactly how a Laravel project wakes up.</p><h4>The Entry Point</h4><p>When a request hits your server (like Nginx or Apache), it is directed straight to public/index.php. This is the front door to your application. Let’s look at the code that greets every single user:</p><pre>&lt;?php<br>use Illuminate\Foundation\Application;<br>use Illuminate\Http\Request;<br>define(&#39;LARAVEL_START&#39;, microtime(true));<br>// Determine if the application is in maintenance mode...<br>if (file_exists($maintenance = __DIR__.&#39;/../storage/framework/maintenance.php&#39;)) {<br>    require $maintenance;<br>}<br>// Register the Composer autoloader...<br>require __DIR__.&#39;/../vendor/autoload.php&#39;;<br>// Bootstrap Laravel and handle the request...<br>/** @var Application $app */<br>$app = require_once __DIR__.&#39;/../bootstrap/app.php&#39;;<br>$app-&gt;handleRequest(Request::capture());</pre><h4>The Setup and the Timer</h4><pre>&lt;?php<br>use Illuminate\Foundation\Application;<br>use Illuminate\Http\Request;<br>define(&#39;LARAVEL_START&#39;, microtime(true));</pre><p>The first two lines pull in the namespaces for the <strong>Application</strong> and the <strong>Request </strong>the two main characters in our story.</p><p>Then, we define LARAVEL_START. This records the exact microsecond the script began executing. It’s essentially a stopwatch that helps developers and debugging tools (like Laravel Telescope) calculate exactly how long it takes for your app to respond to a user.</p><h3>The Safety Switch: Maintenance Mode</h3><pre>// Determine if the application is in maintenance mode...<br>if (file_exists($maintenance = __DIR__.&#39;/../storage/framework/maintenance.php&#39;)) {<br>    require $maintenance;<br>}</pre><p>This defines the <strong>Maintenance Mode</strong>. When you run php artisan down from your terminal, Laravel creates a small file in the storage directory.</p><p>If this file exists, index.php stops the normal boot process right here and loads the maintenance file instead. This is how Laravel shows a &quot;Down for Maintenance&quot; page to your users without you having to change a single line of your actual logic.</p><h3>The Autoloader: Making Classes “Just Work”</h3><pre>// Register the Composer autoloader...<br>require __DIR__.&#39;/../vendor/autoload.php&#39;;</pre><p>In the early days of PHP, we had to manually include or require every single file we wanted to use. It was a management nightmare.</p><p>This line is the magic wand. By requiring the Composer-generated autoloader, Laravel ensures that any class you call — whether it’s a built-in Laravel component or a package you downloaded — is automatically loaded the moment you need it. You don’t have to worry about where the file lives; Composer just finds it.</p><h3>The Bootstrapper: Waking Up the Giant</h3><pre>// Bootstrap Laravel and handle the request...<br>/** @var Application $app */<br>$app = require_once __DIR__.&#39;/../bootstrap/app.php&#39;;</pre><p>If index.php is the front door, bootstrap/app.php is the internal wiring of the house. This line retrieves the <strong>Service Container</strong> (the $app instance).At this stage, Laravel is setting up its core essentials:</p><ul><li><strong>The Container:</strong> The “brain” that manages class dependencies.</li><li><strong>Kernel Registration:</strong> It decides if the request is coming from the web (HTTP) or the terminal (Console).</li><li><strong>Exception Handling:</strong> It prepares a way to catch and report errors before anything even breaks.</li></ul><h3>Handling the Request: The Final Handover</h3><pre>$app-&gt;handleRequest(Request::capture());</pre><p>This is the “Grand Finale” of the entry script. Let’s break down these two parts:</p><ul><li><strong>Request::capture()</strong>: This goes out and grabs everything about the current visit. It looks at the URL, the &quot;GET&quot; or &quot;POST&quot; data, the cookies, and the headers. It packages all of this into a nice, clean Request object.</li><li><strong>handleRequest()</strong>: The $app instance takes that captured request and sends it through the <strong>Router</strong>. The router looks at your routes/web.php, finds the right Controller, passes it through any Middleware (like authentication), and finally returns a <strong>Response</strong>.</li></ul><h3>Conclusion</h3><ul><li>It starts a <strong>timer</strong>.</li><li>It checks for <strong>maintenance</strong>.</li><li>It loads your <strong>dependencies</strong>.</li><li>It initializes the <strong>engine</strong>.</li><li>It captures the <strong>user’s intent</strong> and delivers a result.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca6ee087fe67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Secure Authentication with SSO]]></title>
            <link>https://foysal-dev.medium.com/implementing-secure-authentication-with-sso-cc36451d5ac9?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc36451d5ac9</guid>
            <category><![CDATA[sso]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Thu, 29 Jan 2026 09:09:39 GMT</pubDate>
            <atom:updated>2026-01-29T09:45:03.092Z</atom:updated>
            <content:encoded><![CDATA[<p>Think about a SaaS ecosystem like we deliver to an enterprise client which consists of many different applications (e.g., Chat, HR, Project Management). If each application is using a separate and enclosed authentication mechanism, then, it is a major obstacle.</p><p><strong>The Problem:</strong></p><ul><li><strong>For Users:</strong> Users are suffering a phenomenon called ‘password fatigue’, as simple as that. They have to keep unique passwords for each tool.</li><li><strong>For Developers:</strong> Besides, it adds technical debt to this issue. Because, they are required to code and patch the authentication logic for every service separately.</li></ul><p><strong>The Solution:</strong> We are adopting <strong>Single Sign-On (SSO)</strong> as the primary method of authentication and moving it away from each individual application to be more flexible. Instead of SSO, where a central <strong>Identity Provider (IdP)</strong> first authenticates the user with a secure token and then sends you the token to be able to access the rest of the applications, this way you won’t have to log in multiple times. The authorized user can access the full range of services thanks to the grant of a token. This offers the greatest convenience for users while simultaneously diminishing the danger to the secure area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ZAJ8clhNrGnuXE_oeyJlw.png" /><figcaption>Figure: <strong>Single Sign-On</strong></figcaption></figure><p>To truly understand how Single Sign-On (SSO) decouples authentication from individual applications (like Chat, HR, or Project Management tools), it is necessary to look at the underlying protocols. Modern SSO typically relies on a <strong>Federated Identity</strong> model, most commonly implemented using <strong>OpenID Connect (OIDC)</strong> on top of <strong>OAuth 2.0</strong>.</p><p>In this standard federated model, individual applications do not process or store user credentials. Instead, they establish a trust relationship with a central authority. <strong>OAuth 2.0</strong> acts as the framework for authorization (accessing data), while <strong>OpenID Connect (OIDC)</strong> serves as the identity layer, standardizing how an application verifies a user’s identity and retrieves their profile information.</p><p>Here is how this architecture functions at a system level.</p><h4>1. The Core Components</h4><p>In an OIDC-based architecture, roles are strictly defined:</p><ul><li><strong>The Identity Provider (IdP):</strong> This is the centralized authentication authority (e.g., Auth0, Okta, Azure AD). It holds the user directory, handles credential verification (passwords, MFA), and issues security tokens.</li><li><strong>The Relying Party (RP):</strong> These are the client applications (Service Providers). They are called “Relying Parties” because they rely on the IdP to verify the user’s identity rather than performing the verification themselves.</li></ul><h4>2. The Authentication Flow (Authorization Code Flow)</h4><p>For server-side web applications, the <strong>Authorization Code Flow</strong> is the industry standard. It offers a higher level of security by ensuring that tokens are exchanged directly between servers (back-channel) rather than being exposed in the user’s browser (front-channel).</p><p><strong>The Standard Sequence:</strong></p><ol><li><strong>Initiation:</strong> The user attempts to access an application (the RP) and is redirected to the IdP.</li><li><strong>Redirect:</strong> The redirect URL contains the application’s unique client_id and a registered callback URL (redirect_uri).</li><li><strong>Authentication:</strong> The user authenticates solely on the IdP’s interface. The individual application never sees or handles the user’s credentials.</li><li><strong>Authorization Code:</strong> Upon successful verification, the IdP redirects the user back to the application’s callback URL, appending a temporary, one-time-use <strong>Authorization Code</strong>.</li><li><strong>Token Exchange:</strong> The application’s backend server captures this code and sends a direct, secure HTTP POST request to the IdP to exchange it.</li><li><strong>Session Creation:</strong> The IdP validates the code and responds with an <strong>ID Token</strong> and an <strong>Access Token</strong>. The application validates these tokens and establishes a local session for the user.</li></ol><h4>3. The Artifact: JSON Web Tokens (JWT)</h4><p>The mechanism that enables this stateless verification is the <strong>ID Token</strong>, typically formatted as a <strong>JSON Web Token (JWT)</strong>. This token serves as a portable, verifiable credential.</p><p>Instead of querying a central database for every request, an application can inspect the JWT. A standard OIDC JWT payload includes:</p><ul><li><strong>iss (Issuer):</strong> Confirms the token originates from the trusted IdP.</li><li><strong>sub (Subject):</strong> The unique, stable identifier for the user.</li><li><strong>aud (Audience):</strong> Confirms the token is intended specifically for the requesting application.</li><li><strong>exp (Expiration):</strong> A timestamp indicating when the token becomes invalid.</li></ul><h4>4. Critical Engineering Responsibilities</h4><p>While SSO offloads the burden of <em>storing</em> passwords, it introduces the critical responsibility of <em>validating</em> tokens. A robust implementation requires the application to perform strict checks on every incoming token:</p><ul><li><strong>Signature Verification:</strong> The application must verify that the token was signed by the IdP’s private key (usually by checking against the IdP’s public keys exposed via a standard JWKS endpoint).</li><li><strong>Nonce Validation:</strong> To prevent replay attacks (where an attacker intercepts and reuses a valid token), the application should verify that the nonce value in the token matches the initial request.</li><li><strong>Audience Restriction:</strong> The application must reject any token where the aud claim does not match its own Client ID. This prevents a token issued for one service from being used to access another.</li></ul><h3>Conclusion</h3><p>Adopting a Single Sign-On architecture is not merely a convenience upgrade; it is a fundamental shift in digital identity management. By leveraging the Federated Identity model and OIDC standards, organizations solve two major problems simultaneously: “password fatigue” for users and the complexity of redundant authentication logic for developers.</p><p>The result is a unified, secure, and scalable environment where identity is managed by a single source of truth, allowing development teams to focus on building core product features rather than maintaining security infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc36451d5ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add bits/stdc++ in VS code]]></title>
            <link>https://foysal-dev.medium.com/how-to-add-bits-stdc-in-vs-code-84b61b4912a7?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/84b61b4912a7</guid>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Fri, 02 Jun 2023 18:02:35 GMT</pubDate>
            <atom:updated>2025-10-12T13:16:13.604Z</atom:updated>
            <content:encoded><![CDATA[<ol><li><strong>cmd + click </strong>on <strong>iostram </strong>or any header file it will open the file</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*tz--j4kGjgsIHFKLXWquKg.png" /></figure><p>2. Right click on the file it will open the context menu and click on Reveal on finder it will open the file in the location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*TGs0nOttL1qDmGL8XrbJCQ.png" /></figure><p>03. On that location create a file name <strong>bits<br></strong>(You might need to use your password to create the folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*g4V8JjuLsPqaVupJFe42zg.png" /></figure><p>04. Copy any file with *.h extension and paste it inside bits folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*WofzQ3J9ykLERA4n8cwXNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*YFON5Q3cWL7_QqZ7fzTFtQ.png" /></figure><p>05. Rename the file to stdc++.h</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*G6SzYpKjUayhtviHl87pvg.png" /></figure><p>06. Right click Open it with VS code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*eZd7tiiV1czTnnt_NVYhdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L91jSKeeg58lgPXc2Wk6sw.png" /></figure><p>07. Add this content inside the file</p><pre>// -*- C++ -*-<br>//===----------------------------------------------------------------------===//<br>//<br>// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.<br>// See https://llvm.org/LICENSE.txt for license information.<br>// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception<br>//<br>//===----------------------------------------------------------------------===//<br><br>#ifndef _LIBCPP___MBSTATE_T_H<br>#define _LIBCPP___MBSTATE_T_H<br><br>#include &lt;__config&gt;<br><br>#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)<br>#  pragma GCC system_header<br>#endif<br><br>// TODO(ldionne):<br>// The goal of this header is to provide mbstate_t without having to pull in<br>// &lt;wchar.h&gt; or &lt;uchar.h&gt;. This is necessary because we need that type even<br>// when we don&#39;t have (or try to provide) support for wchar_t, because several<br>// types like std::fpos are defined in terms of mbstate_t.<br>//<br>// This is a gruesome hack, but I don&#39;t know how to make it cleaner for<br>// the time being.<br><br>#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS<br>#   include &lt;wchar.h&gt; // for mbstate_t<br>#elif __has_include(&lt;bits/types/mbstate_t.h&gt;)<br>#   include &lt;bits/types/mbstate_t.h&gt; // works on most Unixes<br>#elif __has_include(&lt;sys/_types/_mbstate_t.h&gt;)<br>#   include &lt;sys/_types/_mbstate_t.h&gt; // works on Darwin<br>#elif defined(_LIBCPP_ON_RTKIT)<br>#   include_next &lt;wchar.h&gt;<br>#elif defined(_LIBCPP_ON_SEP)<br>struct mbstate_t; // just forward declare it to satisfy &lt;iosfwd&gt;<br>#else<br>#   error &quot;The library was configured without support for wide-characters, but we don&#39;t know how to get the definition of mbstate_t without &lt;wchar.h&gt; on your platform.&quot;<br>#endif<br><br>_LIBCPP_BEGIN_NAMESPACE_STD<br><br>using ::mbstate_t _LIBCPP_USING_IF_EXISTS;<br><br>_LIBCPP_END_NAMESPACE_STD<br><br>#endif // _LIBCPP___MBSTATE_T_H</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3gGXnj0yYXWgxi9VgvoSRw.png" /></figure><p>08. Save it and restart VS code</p><p>If you find any difficulty let me know. We will figure it out <a href="https://emojipedia.org/winking-face/">😉</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84b61b4912a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to think about Matchstick problems]]></title>
            <link>https://foysal-dev.medium.com/how-to-think-about-matchstick-problems-30c620a4e6b?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c620a4e6b</guid>
            <category><![CDATA[problem-solving]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Fri, 05 May 2023 15:07:11 GMT</pubDate>
            <atom:updated>2023-05-05T15:07:11.796Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*N66oCocuPVq8nVpCCMKuXQ.png" /><figcaption>Matchsticks</figcaption></figure><p><strong>The problem statement is something like this :<br></strong>We will be given a number of matchsticks and we need to find out what is the smallest number we can form from the number.</p><p>Here are some conditions to make our life easier.<br> 1. There may be leading zeros in the number<br> 2. Every stick must be used</p><p><strong>Let&#39;s understand and analyze the problem first : <br>Firstly</strong> let&#39;s try to find a pattern. Then it will be easier to implement on code.</p><p>From the sticks, we can observe we need at least 2 sticks to form a number. Lets start from there.</p><p>If we were given 2 we can form 1(Notice in the matchsticks picture to form 1 it takes two sticks).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/136/1*-h3G20ygbMgPMBpZIBEMxQ.png" /><figcaption>One takes two sticks only</figcaption></figure><p>If we are given 3 then we could form 7(from the image we can notice 7 takes 3 sticks)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*3wAwcsGLDxvHhk_Myxns5w.png" /><figcaption>7 takes 3 sticks</figcaption></figure><p>If we were given 4we can form 4((from the image we can notice 4 takes 4 sticks)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*1IGGAUhCjjAcHTZCX6A2Ng.png" /><figcaption>4 takes 4 sticks</figcaption></figure><p>If we were given 5 then might run into a problem. Cause if we notice from the 5 sticks we can form 2, 3, and 5. As all of them take 5 sticks and form the statement we can decide that 2 is the smaller. So if we have 5 sticks we can form 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*2bvMDrGPj2n9Feah_8rLZg.png" /><figcaption>2 takes 5 sticks</figcaption></figure><p>If we were given six sticks then we can form 0, 6, and 9 as 0 is the smallest number among them so we can conclude the smallest number we can form is 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*_F2kgOdn0xcHBS7Qa_Zt3w.png" /><figcaption>0 takes 6 sticks</figcaption></figure><p>Moving on if we have 7 sticks we can form 8. With all the sticks. Like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*mjdfNjU3UgWGz9RFoqTazw.png" /><figcaption>8 with 7 sticks</figcaption></figure><p>Great this was the final number in single digits we can form with sticks.</p><p>Let&#39;s summarize upto this before moving on. <br>For, <br> 2 sticks → number can be formed 1<br> 3 sticks → number that can be formed is 7 <br> 4 sticks → number that can be formed is 4<br> 5 sticks → number that can be formed is 2, 3, 5 → smallest is 2<br> 6 sticks → number that can be formed is 0, 6, 9 → smallest is 0<br> 7 sticks → number that can be formed is 8</p><p>Note: <br>1. With 2, 3, 4, 5, 6, and 7 numbers can be formed. <br>2. Smallest number 0 can be formed with 6 sticks</p><p>Let&#39;s move on,</p><p>If we were given 8 sticks then we could there are a number of choices we could have. <br>We can break 8 into the summation of available sticks possible (2, 3, 4, 5, 6, 7)<br>2 + 2 + 2 + 2 = 8which will form 1111<br>3 + 5 = 8 which will form 72 or 27<br>6 + 2 = 8 which will form 01 or 10</p><p>Here from the cases, we can decide 01 is the smallest number.</p><p>Moving on,<br>If we were given 9 sticks then we could there are a number of choices we could have. <br>We can break 9 into the summation of available sticks possible (2, 3, 4, 5, 6, 7)<br>7 + 2 = 9 which will form 18 or 81<br>3 + 6= 9 which will form 70 or 07<br>5 + 2 + 2 which will form 211 or 121 or 112 (By taking 2 as the smallest)<br>5 + 4 which will form 24 or 42</p><p>Here from the cases, we can decide 07 is the smallest number.</p><p>If we notice closely the case of 8 and 9. If we have a leading 0 it is becoming the smallest number and the leading 0 is coming from 6 sticks. So we can decide from here we need to form as much as leading 0 we can. To do that we can divide the number by 6 and the result will be the number of zeros.</p><p>Like this,</p><p>For, <br> 12 → The smallest number will be 00 <br> 18 → The smallest number will be 000<br> 24 → The smallest number will be 0000 and so on.</p><p>If have numbers that are not divisible with 6 we just take the integer part as a number of leading 0. <br>For 14 number of leading 0 will be 00(2), For 15, 16, and 17 it will be zero as well and the remainder is 2,3, 4, and 6 accordingly.</p><p>So we can form a formula here, <br>We need to divide the number into two parts one is a multiple of 6 which will produce the highest number of leading 0.</p><p>After dividing any number by 6 we can have 0–5 remainder. <br>We can think of it as, <br>Suppose we have 60 match sticks we used all of them to produce 10 zeros. <br>If we have 65 we could use 60 sticks to produce 10 zeros and we would have 5 sticks remaining. And with those 5 sticks, we could form 2. as 2 is the smallest number.</p><p>Now let&#39;s organize this idea, <br>First, we need to break the number into two pieces one part will be the multiple of 6. Which will create a leading 0 and another part will be the remainder.</p><p>48 → 6 X 8 = 48 + 0<br>49 → 6 X 8 = 48 + 1<br>50 → 6 X 8 = 48 + 2<br>51 → 6 X 8 = 48 + 3<br>52 → 6 X 8 = 48 + 4<br>53 → 6 X 8 = 48 + 5<br>54 → 6 X 9= 54 + 0<br>55 → 6 X 9= 54 + 1<br>56 → 6 X 9 = 54 + 2<br>57 → 6 X 9= 54 + 3<br>58 → 6 X 9= 54 + 4<br>59 → 6 X 9= 54 + 5<br>60 → 6 X 9 = 60 + 0</p><p>If we notice we got our pattern to follow. The remainder is from 0 — 5. After diving by 6. We can have 0 – 5 remainder only.<br> Now let&#39;s use the remainder. <br>If we have remainder as 0 then we don’t need to do anything. <br>If we have the remainder as 2 then we can form 1 with these two sticks <br>If we have the remainder as 3 then we can form 7 with these two sticks<br>If we have the remainder as 4 then we can form 4 with these two sticks<br>If we have the remainder as 5 then we can form 2 with these two sticks</p><p>If we notice the one is missing here only let&#39;s solve the last part of the puzzle. If we have one then we can see we don’t have a number that can be formed with this one so that.</p><p>As we need to use all the sticks we need to think about it a bit.</p><p>As our goal is to use it to produce as much leading 0 we can. So we can form think of it like thinks we will take one six which was producing zero. So the number of sticks now we have is 7(6 + 1) <br>With the 7 sticks from the previous image, we can see we can produce 8 as a single digit.</p><p>Like, <br>If we have 13 sticks we will have 6 digits for creating one zero and the rest seven digits for 8. So the final output will be 08. <br>If we have 61. Then will will have 9 x 6 = 54 sticks form creating zero and rest seven for creating 8.</p><p>The code implementation in c could be something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*If5xNCh1Jmo34vfAokeZDQ.png" /></figure><p>Here we are first handling the 1 part then the rest part.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c620a4e6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic coding problems with solution in Java]]></title>
            <link>https://foysal-dev.medium.com/basic-coding-problems-with-solution-in-java-64018145a6b1?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/64018145a6b1</guid>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Thu, 05 Nov 2020 21:57:16 GMT</pubDate>
            <atom:updated>2020-11-05T21:57:16.699Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Basic coding problems with solution in Javascript</strong></h3><h3><strong>01. Find the largest integer of array</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*GmgR2lE0bObzEnmMQ9RZ9g.png" /></figure><p>First we declare a variable with a value of 0 to hold the largest number then we loop over the array and compare the largest number variable with all of the array element if the element is greater than or equal to the largest number we are reassigning the value. After looping over all the element of array we will get the largest number of the array .</p><p>02. <strong>Find the largest word in a sentence</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*s-IKQ7EFi33Iv8NhhEKlsw.png" /></figure><p>There are many ways to find the largest word in a sentence. In this example first we converted the sentence to an array using JavaScript built in split() method. Then we declare a variable to hold the largest word and set it’s value as empty string . Then we loop over the the word Array and then compare between the current element of the loop. If the length of current element is greater than largest word then we will set the current element as largest word .</p><p><strong>03. Sum of all numbers in an array</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*lgLwafehPw_lRYTCiX0j1Q.png" /></figure><p>We have given an array. We have to find the sum of the all element of this array. To find the sum we declared a variable and set it’s initial value to 0. Then we loop over the array and added the current element to sum and finally we got the total sum of the array.</p><p><strong>04. Sum of all numbers in a range</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*rbKqk2oclB23ZIDLWRKSpw.png" /></figure><p>To solve this problem we have declared a function and it requires two arguments one is from where and to where . Then inside the function we have declared a variable to store the sum . And loop over from given number to the “to” number and adding the current element to the sum. And returning the sum from the function.</p><p>05. <strong>Remove duplicate elements from an array (not using for loop)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*ijpqD3tAUetXBwC6UVIpBA.png" /></figure><p>For solving this problem we will use JavaScript filter method . We are checking if the item exists in the array. And then putting all together in a newArray which is the unique elements array.</p><p><strong>06. Find even numbers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*TYfm74Gt06U9bj2bf8SubA.png" /></figure><p>Even numbers are those numbers which are perfectly divided by 2. Here is in the is is even function we are checking if the number is perfectly divided by 2 or not if it is then we are returning true otherwise false.</p><p><strong>07. Find odd numbers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*giXSVuJac-9OuuT9w4n_Eg.png" /></figure><p>In the case of odd numbers we are doing the same as before described in no-6 difference is we are checking if the number is not divisible with 2 or not . If it is then we are returning true otherwise false.</p><p>08. <strong>Count the numbers of words in an sentence</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*L5nHs6PLn7sqsQutRsshhg.png" /></figure><p>To count the number of words in a sentence we have to convert the sentence into a array using the split method the first argument will be “ ”(space) and it will split the sentence into an array . If we return the length of that array we will get the number of words .</p><p><strong>09. Reverse a string</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*Y7wJ0qr6TxTsXM48TkUFJw.png" /></figure><p>To reverse a string or word we have to convert the string into an array then we can use the build in array method to reverse the array and lastly we can join the element of that using built in JavaScript join() method.</p><p><strong>10. Truncate a sentence</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*W9bQWllbMAqzWIOSh8Kf6Q.png" /></figure><p>To truncate a sentence we have to use splice() method it will cut the sentence in specified index of the sentence and return the truncated string</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64018145a6b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Core concepts in React JS]]></title>
            <link>https://foysal-dev.medium.com/10-core-concepts-in-react-js-f6e0a93e785b?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6e0a93e785b</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Wed, 04 Nov 2020 14:12:55 GMT</pubDate>
            <atom:updated>2020-11-04T14:12:55.358Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is React JS ?</h3><p>React JS is a JavaScript library for creating UI. It’s not a framework , its a library which is used for creating interactive UI . <br>We can install react form the command prompt using a single command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*mFAiHnNQPXqUoTipb6tVPQ.png" /><figcaption>install react</figcaption></figure><h3>JSX</h3><p>JSX stands for JavaScript XML. It allows us to write HTML in React. It’s like plain HTML React allows us to write JSX element. It’s make easier to write code. Here is an example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*DI8zu8DeN1YwOQGMHwe6fg.png" /></figure><h3>Virtual DOM</h3><p>React creates virtual DOM to render components in the UI. <br>When something changes to the virtual dom it find the component and re render that component only .</p><h3>Component</h3><p>Components are reusable code block that could be used as many time as we can . In React there are two types of component one is functional component and the other one is class component .</p><h3>Context API</h3><p>Context api is an alternative of props drilling . It create global variable that can be accessible form anywhere in the app .</p><h3>Props</h3><p>Pros is the information that is passed from the parent component to the child component. It is very useful for passing data from one component to another component.</p><h3>PropTypes</h3><p>Proptypes is a node modules that can be very useful for verifying props data. It shows an error if we do not pass any required props and also shows error if we do not pass the valid type of data to the child components. <br>To install :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*1EQPR-tcMp3zlT4jcpmeFw.png" /></figure><h3>Routing</h3><p>In react if we want to change pages using anchor element we have to wait for full page reload . react-router-dom solves the problem It do not takes a page reload when we changes one route to another .To install react-router-dom</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*cKSJa9YUKBq8bts7SEiO_A.png" /></figure><h3>Default Props</h3><p>When we need to set default props we set the default props for a components . If we pass a prop it will use the prop but if we don’t pass any props its use the default props . It make our code more cleaner and make our life a little bit easier.</p><h3>React Testing</h3><p>There are many library for testing react code. Jest and react testing library is the most popular. We can test our components using jest and react testing library . Jest was developed by facebook , react was also created by facebook.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6e0a93e785b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 useful things on Javascript]]></title>
            <link>https://foysal-dev.medium.com/10-useful-things-on-javascript-ccd7c9faa994?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccd7c9faa994</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[data-type]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 13:30:07 GMT</pubDate>
            <atom:updated>2020-11-03T13:30:07.998Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data types</h3><p>Data type are very import in every programming languages. In JavaScript there are mainly two kinds of values one is Primitive values(Numbers and strings ) and another is Reference type(Objects and functions).Array is also a special kind of objects so they are reference type. Primitive type data are undefined, numbers, symbol, bigInt, boolean. <br>Reference type data are objects , arrays and functions.</p><h3><strong>Try Catch</strong></h3><p>To handle error we use try catch in JavaScript . The syntax is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*V6byQqXC95V_zvMbLHOAfg.png" /><figcaption>try catch syntax</figcaption></figure><p>In try catch block compiler first try to execute the code of try block if it fails to execute the controls goes to the catch block . In catch block we have access to a argument called error . We can get the information about the error in error .</p><h3>Variable declaration</h3><p>Variable is like a container in JavaScript or programing in general and the name of the variable is the label of the container. We can declare a variable in in JavaScript in three ways using var, const and let.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*27V3JkQmjUnxCX8ujQoqSw.png" /><figcaption>Variable declaration</figcaption></figure><h3>Arrow function</h3><p>Arrow function is a new addition in ES6 JavaScript syntax. It is shorter and simpler . Here is an example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*bL6W0XL4ZCgvqr3ivJ9fGw.png" /></figure><h3>Promises</h3><p>Promises are very useful for handling asynchronous action in JavaScript. Promises has three state</p><p>Pending -&gt;When a promise is created.<br>Fulfilled -&gt; Action performed successfully(then block will execute)<br>Rejected -&gt;Action was unsuccessful (catch block will execute )</p><p>Here is an examples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*_UMM8shEdG-sS0kXihwhRw.png" /></figure><h3>Falsy Values</h3><p>In JavaScript there are many values which considered as false while parsing by the JavaScript engine <br>They are undefined, null, NaN, “”(empty string), [](empty array), {}(empty object)</p><h3>Comments</h3><p>Commenting is necessary when we try to not execute a code or simply just want to say something about code but we don’t want them to run by the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*M3B63iSYaDWUXeQ26H3pKw.png" /><figcaption>Comment example</figcaption></figure><h3>Spread operator</h3><p>In JavaScript ES6 we have a new operator called spread operator . This makes our life so much easier<br>Here is an example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*ZFeRLz0dnu384mFtdccwzg.png" /></figure><h3>Parameter</h3><p>Parameter is a special kind of variable that is used to pass information in function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*X4VK2Ks5jqCr78zdmtjGyQ.png" /></figure><p>Here name is a parameter which is a variable for passing name .</p><h3>Arguments</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*dflz0T4ZO9ywFjwE82mSpQ.png" /></figure><p>Argument is the value we passed in a function . Here Foysal is the argument of intro function and name is the parameter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccd7c9faa994" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 basic things on JavaScript or programming]]></title>
            <link>https://foysal-dev.medium.com/10-basic-things-on-javascript-or-programming-73b09767d2f?source=rss-9732a8c42fdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/73b09767d2f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[basic-javascritp]]></category>
            <dc:creator><![CDATA[Foysal Ahammed Sami]]></dc:creator>
            <pubDate>Mon, 02 Nov 2020 03:34:22 GMT</pubDate>
            <atom:updated>2020-11-02T03:35:12.996Z</atom:updated>
            <content:encoded><![CDATA[<h3>10 basic things on JavaScript or programming in general</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*ZdP2dzKXOvU6qdHlQh2Eyw.jpeg" /></figure><ul><li><strong>Variables</strong></li></ul><p>Like every programming languages variables just like a container which can contain anything like numbers, strings, objects, arrays and even functions. The name of the variables is like the label of the container. <br>Variables in JavaScript can be created with var, const and let keyword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*GP_R8MzMx8YoO8N7lUkc1A.png" /></figure><ul><li><strong>Strings</strong></li></ul><p>Strings are a sequences of characters in JavaScript. In strings are created with string literals like single quote, double quotes, back-ticks and also using toString() method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*JV1_b378a-qFedqTTCMIJQ.png" /></figure><ul><li><strong>Numbers</strong></li></ul><p>Like other programming languages number in JavaScript can performs mathematical operation. In JavaScript every number stored as float. There is not integer. We can convert a float number using built in JavaScript functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*WsmHjnTjO9JMmMSTVy26Aw.png" /></figure><ul><li><strong>Objects</strong></li></ul><p>Objects in JS is a key value pair which we can use for storing data.This is almost like real life objects. In JavaScript almost everything is an object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*j6I8GrcNbOcp9yvexkaxOg.png" /></figure><ul><li><strong>Array</strong></li></ul><p>Array is a special kind of Object. Which key is usually the numbers starting from 0 . Any element of an array can be accessed by it’s index. When we need to store more than one information in a variable we can use array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*he7tjCt9975fBEpVYbxknA.png" /><figcaption>An basic array example</figcaption></figure><ul><li><strong>Functions</strong></li></ul><p>Function is a block of code which performs a action when we called the function . Function is used to reduce code duplication as well as maintain DRY(Don’t repeat Yourself) principal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*fyxsxRmBy02XvzAvi4_FxQ.png" /><figcaption>A simple function</figcaption></figure><ul><li><strong>Loop</strong></li></ul><p>Like other programming languages loop is used for doing a task until for a specific amount of time or running a block of codes until the condition is false. for , while, do … while, for … in, for ..of , performs loop operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*QYr13EwENgxzYl9sYAuQSw.png" /></figure><ul><li><strong>Condition</strong></li></ul><p>If we want to run a code of block based on a condition we have to conditional operators . if, if.. else are used for conditional operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*ht0oohXdMU2AW7KAc77b0w.png" /></figure><ul><li><strong>The “this” key word</strong></li></ul><p>The “this” keyword is confusing in JavaScript. The this keyword in JavaScript always refers to the object form where it is called.</p><ul><li><strong>Falsy and truthy values</strong></li></ul><p>In JavaScript false, 0 , undefined, null, NaN , “”(empty string) are considered as a falsy value. and anything else considered as truthy values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73b09767d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>