<?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 Alok Raj on Medium]]></title>
        <description><![CDATA[Stories by Alok Raj on Medium]]></description>
        <link>https://medium.com/@alok722?source=rss-e10e116247f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*V41s1241xrUO3kvuO_MbKw.png</url>
            <title>Stories by Alok Raj on Medium</title>
            <link>https://medium.com/@alok722?source=rss-e10e116247f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:39:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alok722/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[Summary of React India — 2022 ]]></title>
            <link>https://alok722.medium.com/summary-of-react-india-2022-bccffee2c879?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bccffee2c879</guid>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 14:33:51 GMT</pubDate>
            <atom:updated>2022-10-22T14:33:51.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fOhe-67hKcAbjhNEmPIkaQ.jpeg" /></figure><h3>Summary of React India — 2022 🚀</h3><h4>It’s been a wonderful experience of witnessing React India live in Goa. Here are the summary and keynotes from the event.</h4><h3>📌 The Web’s Next Transformation</h3><p>by <a href="https://twitter.com/kentcdodds">Kent C Dodds</a></p><p>Slides and Demo: <a href="https://github.com/kentcdodds/the-webs-next-transformation">github.com/kentcdodds/the-webs-next-transfo..</a><br>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=2040s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=2040s</a></p><p>This talk basically discusses “ <strong>A Journey through time as a web dev</strong> “ by building the same web app during different phases of the web dev tech cycle.</p><p><strong>The Journey</strong>: MPA -&gt; PEMPA -&gt; SPA -&gt; The Next Phase (PESPAs)…</p><ul><li>MPA: Multi-Page Apps</li><li>PEMPA: Progressively Enhanced Multi-Page Apps (JS Sprinkles)</li><li>SPA: Single Page Apps</li><li>PESPAs: Progressively Enhanced Single Page Apps (Remix)</li></ul><p>The web. What started as a document-sharing platform has evolved into an application platform. The web has been through a number of transformations over the years. From static HTML files to dynamic server-generated HTML responses. Then to REST or GraphQL APIs consumed by JavaScript-heavy clients with the Jamstack. The web is entering a completely new transformation. Modern infrastructure and techniques have changed the rules of what it means to make an excellent user experience. In this new future, what’s old is new and what’s modern is lacking.</p><p>PESPAs are distinguished by these characteristics:</p><ul><li>Functional is the baseline — JS is used to enhance not enable</li><li>Lazy loading + intelligent pre-fetching (more than just JS code)</li><li>Pushes code to the server</li><li>No manual duplication of UI code (as in PEMPAs)</li><li>Transparent browser emulation (#useThePlatform)</li></ul><p>In Review:</p><ul><li>Transitions involve both Frontend and Backend</li><li>Transitions are primarily about moving where code lives (where it’s written, who writes it, and where it’s run)</li><li>Every transition had motivations</li><li>Transitions can impact UX and DX in both positive and negative ways</li><li>Every transition comes with trade-offs (including this one)</li><li>We are often unaware of the impact of trade-offs until after the transition</li><li>The transition to Progressively Enhanced Single Page Apps (PESPAs) improves both UX and DX.</li></ul><h3>📌 MicroInteractions: a perfect bow to the arrow of modern web development</h3><p>by <a href="https://twitter.com/harshcrop">Harsh Shah</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=4630s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=4630s</a></p><p>This talk basically discusses how a micro-interaction into your web app or mobile app can significantly add up to the growth of production.<br>MicroInteractions take your application from ordinary to exceptional. It is basically by adding meaningful animations.<br>A small example could be the red heart sparkle on the Twitter-like button. It gives the user satisfaction of liking something.<br>Don’t be annoying, too much animation is bad.</p><p>SVG API &amp; Library Examples for animation:</p><ul><li><a href="https://react-spring.dev/">react-spring.dev</a></li><li><a href="https://svgjs.dev/docs/3.0/">svgjs.dev/docs/3.0</a></li><li><a href="https://greensock.com/">greensock.com</a></li><li><a href="http://snapsvg.io/">snapsvg.io</a></li></ul><h3>📌 How I built Design System Builder!</h3><p>by <a href="https://twitter.com/makkar_meenu">Meenu Makkar</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=5836s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=5836s</a></p><p>This talk mostly discusses the design system of a company, how to approach it, its challenges and how we can fix all of this using a tool called <a href="https://builderx.io/">BuilderX</a>.</p><p>Design Process Phase: Research -&gt; Define -&gt; Ideate -&gt; Test -&gt; Prototype</p><p><a href="https://cssstats.com/">cssstats.com</a>: It is a great tool to extract CSS-oriented information from any website.</p><p>The journey of building BuilderX started at <a href="https://nativebase.io/">nativebase.io</a>.</p><p><strong>What is BuilderX?</strong><br>BuilderX is a browser-based design tool that codes React Native &amp; React for you. It is an extensive tool that pretty much solves all problems of the Design System.</p><h3>📌 Understanding Concurrent React with Hacks</h3><p>by <a href="https://twitter.com/TejasKumar_">Tejas Kumar</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10000s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10000s</a></p><p>This talk discusses concurrent react with a live coding example, with a hack, sort of workaround in order to first build and try and then go ahead and look for the perfect way.</p><p>3 ways to fetch Data in React:</p><p>More @ <a href="https://blog.logrocket.com/react-suspense-data-fetching">blog.logrocket.com/react-suspense-data-fetc..</a></p><h3>📌 React Hooks broke my tests, now what?</h3><p>by <a href="https://twitter.com/danieljcafonso">Daniel Afonso</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=12838s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=12838s</a></p><p>This talk discusses React Testing Library and how it can fulfill almost all the requirements of Unit testing in React. It also talks about the downside of enzymes.</p><p>Afterward, this talk is like a crash course in to React Testing Library. It also discusses common issues we face in React Testing Library and common mistakes like:</p><ul><li>Using act</li><li>Using getBy with expect().not.toBeInTheDocument()</li><li>Using await with fireEvent or non-async queries.</li><li>Using await waitFor()</li><li>Using cleanup</li><li>Using waitFor with synchronous queries</li><li>Using side effects inside waitFor At last, it discusses the famous react testing library issue that “<strong>was not wrapped in the act (…)</strong>”</li></ul><h3>📌 Revisiting end-to-end testing for better reliability, speed, and D.X. at scale</h3><p>by <a href="https://twitter.com/anooprav7">Anoop Raveendran</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=15251s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=15251s</a></p><p>This talk discusses how Playwright has simplified the e2e testing of Rippling.<br>Techs to simplify e2e testing: Playwright, Playwright Test for VSCode, Playwright-merge-html-reports</p><p>Rippling strategy to reduce build time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6vu8u8_lzNVXovYe" /></figure><h3>📌 Fullstack Typesafety with Next.js</h3><p>by <a href="https://twitter.com/flybayer">Brandon Bayer</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s</a> Slides Link: <a href="https://drive.google.com/file/d/1q-TbIEailr8sFu3YuzXDoDIloc8DJ1Mn/view">drive.google.com/file/d/1q-TbIEailr8sFu3Yuz..</a></p><p>This talk discusses the importance of TypeScript and why it is a must and how it can avoid production issues. It also points out the wrong practice generally people follow is ! Or as any. One famous fix it discusses is &quot;How to fix may be undefined&quot;? Every detail is available in the slides. The slides also have a great reference for Typescript docs and libraries which could be of great help.</p><h3>📌 Supercharging Your Dev Experience with Turborepo</h3><p>by <a href="https://twitter.com/bpaulino0">Bruno Paulino</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s</a><br>Repo/Slides: <a href="https://github.com/brunojppb/react-india">github.com/brunojppb/react-india</a></p><p>A good reference: <a href="https://egghead.io/courses/refactor-an-existing-monorepo-to-turborepo-79d6b32d">egghead.io/courses/refactor-an-existing-mon..</a></p><p>This talk discusses how we could leverage turbo(Turborepo reimagines build system techniques used by Facebook and Google to remove maintenance burden and overhead) to avoid multi-repos.<br>It discusses, Why monorepos are so hot right now?</p><ul><li>Code reuse</li><li>Shared Standards</li><li>Team collaboration</li><li>Atomic changes</li></ul><h3>📌 Code crimes for good component APIs</h3><p>by <a href="https://twitter.com/siddharthkp">Siddharth Kshetrapal</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=10001s</a><br>This talk discusses how sometime a work around (crime) could be a good thing. He has explained the situation by taking the Github component as an example. “ <em>Hacks that make the code easier to read and author, helping developers do a good job fast, within reasonable constraints of the system are okay</em> “</p><h3>📌 Decentralized GraphQL APIs: Indexing blockchain data using The Graph</h3><p>by <a href="https://twitter.com/VishwaMehta30">Vishwa Mehta</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=28075s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=28075s</a><br>This talk discusses graphql in contrast to web3.<br>Reference: <a href="https://thegraph.com/en/">thegraph.com/en</a></p><h3>📌 Deep diving on Concurrent React</h3><p>by <a href="https://twitter.com/ythecombinator">Matheus Albuquerque</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=30000s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=30000s</a><br>Slides: <a href="https://speakerdeck.com/ythecombinator/react-india-2022">speakerdeck.com/ythecombinator/react-india-..</a></p><p>This talk discusses how proper scheduling improves the app’s experience by diving into some concurrent React features, understanding their rationales, and how they work under the hood.</p><h3>📌 Calm down your overreactive forms with uncontrolled components</h3><p>by <a href="https://twitter.com/blenderskool">Akash Hamirwasia</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=32900s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=32900s</a><br>Slides: <a href="https://slides.akashhamirwasia.com/">slides.akashhamirwasia.com</a> -&gt; Press the next arrow key after visiting this link.</p><p>This talk discusses how we can avoid a lot of re-renders using uncontrolled components. Basically, it talks about the internal implementation of <a href="https://react-hook-form.com/">react-hook-form</a>.</p><h3>🌐 Panel Discussion: What are the expectations from the web framework?</h3><p>Live Video Link: <a href="https://www.youtube.com/watch?v=w2MQzZ1dSZY&amp;t=34850s">youtube.com/watch?v=w2MQzZ1dSZY&amp;t=34850s</a></p><p>This talk is a panel discussion among developers talking “What to think about while choosing any web framework?”</p><h3>📌 E2E tests: Write once and run anywhere</h3><p>by <a href="https://twitter.com/vilvaathibanpb">Vilva Athiban</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=3135s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=3135s</a></p><p>This talk discusses tech stack which potentially is one codebase of e2e test for web/mobile even for native apps. CucumberJS + AppiumJS + Web Driver<br>Ref: <a href="https://webdriver.io/">webdriver.io</a></p><h3>📌 Wait, React is Multithreaded?</h3><p>by <a href="https://twitter.com/niksharma1997">Nikhil Sharma</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=4825s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=4825s</a></p><p>This talk discusses how we could leverage web worker to delicate heavy computation.<br>Ref: <a href="https://github.com/alewin/useWorker">github.com/alewin/useWorker</a></p><p>by <a href="https://www.linkedin.com/in/malwina-kubas/">Malwina Kubas</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=6300s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=6300s</a></p><p>This talk discusses sustainable development and how small decisions could have a large impact on carbon emissions. I would highly recommend watching this as it highlights how small changes in our digital behavior could have a large impact. Please refer to more @ <a href="http://ec0lint.com/">ec0lint.com</a></p><h3>📌 Evolution of JS Bundlers</h3><p>by <a href="https://twitter.com/kvikram1988">Vikram Gupta</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=10350s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=10350s</a><br>This talk discusses how JS Bundlers have evolved over time.</p><h3>📌 The sorcery of building a cross-platform design system architecture</h3><p>by <a href="https://twitter.com/_kamlesh_">Kamlesh Chandnani</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=13000s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=13000s</a></p><p>This talk discusses the approach that could build a unified cross-platform design system.</p><h3>📌 web3uiKit by Moralis, the FrontEnd of web3 made easy</h3><p>by <a href="https://twitter.com/billgil">Bill Gilmore</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=15570s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=15570s</a></p><p>This talk discusses what is web3, what problem it is solving, and how one could start with this. Ref: <a href="https://web3ui.github.io/web3uikit/">web3ui.github.io/web3uikit</a>, <a href="https://moralis.io/">moralis.io</a></p><h3>📌 Zero bundle size React Server components</h3><p>by <a href="https://www.reactindia.io/speakers/aashima-ahuja">Aashima Ahuja</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=23130s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=23130s</a><br>This talk starts by discussing the difference between CSR &amp; SSR and their pros and cons.</p><h3>📌 Overcoming SEO vs Performance tradeoffs with Dynamic Rendering</h3><p>by <a href="https://twitter.com/reach_to_parth">Parth Mahajan</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=24315s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=24315s</a></p><h3>📌 Reducing bugs in a React codebase</h3><p>by Shyam Swaroop, Darshita Chaturvedi</p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=26130s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=26130s</a><br>Code/Slides: <a href="https://github.com/Atri-Labs/conferences/tree/main/ReactIndia2022">github.com/Atri-Labs/conferences/tree/main/..</a></p><h3>📌 Building a custom renderer using React</h3><p>by <a href="https://www.linkedin.com/in/mohamed-rafi-364862a0/">Mohamed Rafi</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=27900s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=27900s</a></p><h3>📌 React Native in Microsoft’s Office Mobile — how we improved the DX to deliver faster &amp; better code</h3><p>by <a href="https://twitter.com/rohanpdofficial">Rohan Prasad</a></p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=29160s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=29160s</a></p><h3>📌 Building a next-generation web app, A Hotstar special.</h3><p>by <a href="https://twitter.com/abhighyaa">Abhighyaa Jain</a>, Neeraj Rajpurohit</p><p>Live Video Link: <a href="https://www.youtube.com/watch?v=Hy11T_eoUHg&amp;t=31281s">youtube.com/watch?v=Hy11T_eoUHg&amp;t=31281s</a></p><p>This is a must-watch video as this talk discusses how Hotstar has solved large-scale problems using different architecture.</p><blockquote><em>Thanks For Reading 😃</em></blockquote><p><a href="https://www.reactindia.io/">https://www.reactindia.io</a></p><p><em>Originally published at </em><a href="https://alok722.hashnode.dev/summary-of-react-india-2022"><em>https://alok722.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bccffee2c879" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YDKJS — SCOPE & CLOSURES, Takeaways for Experienced JavaScript Developer]]></title>
            <link>https://alok722.medium.com/ydkjs-scope-closures-takeaways-for-experienced-javascript-developer-1d571eee5e4?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d571eee5e4</guid>
            <category><![CDATA[kyle-simpson]]></category>
            <category><![CDATA[best-javascript-books]]></category>
            <category><![CDATA[ydkjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Fri, 10 Jun 2022 10:52:05 GMT</pubDate>
            <atom:updated>2022-06-10T10:56:32.974Z</atom:updated>
            <content:encoded><![CDATA[<h3>YDKJS — SCOPE &amp; CLOSURES, Takeaways for Experienced JavaScript Developer</h3><figure><img alt="ydkjs — scope &amp; closures" src="https://cdn-images-1.medium.com/max/1024/1*8IOYilf_3Y7-4VSKqnZMDQ.png" /></figure><p>Important takeaways from Kyle Simpson’s YDKJS book series — Scope &amp; Closures</p><h3>Chapter 1 — What is Scope?</h3><p>The inclusion of variables into our program begets the most interesting questions we will now address: where do those variables live? In other words, where are they stored? And, most important, how does our program find them when it needs them? These questions speak to the need for a well-defined set of rules for storing variables in some location, and for finding those variables at a later time. We’ll call that set of rules: <strong>scope</strong>. But, where and how do these scope rules get set?</p><h4>Compiler Theory</h4><p>JavaScript falls under the general category of “dynamic” or “interpreted” languages, it is in fact a compiled language. It is not compiled well in advance, as are many traditionally compiled languages, nor are the results of compilation portable among various distributed systems. But, nevertheless, the JavaScript engine performs many of the same steps, albeit in more sophisticated ways than we may commonly be aware of any traditional language compiler.</p><p>In a traditional compiled-language process, a chunk of source code, your program, will undergo typically three steps before it is executed, roughly called “compilation”:</p><ul><li>Tokenizing/Lexing: Breaking up a string of characters into meaningful (to the language) chunks, called tokens.</li><li>Parsing: Taking a stream (array) of tokens and turning it into a tree of nested elements, which collectively represent the grammatical structure of the program. This tree is called an “AST” (abstract syntax tree) (<a href="https://astexplorer.net/">astexplorer.net</a>).</li><li>Code-Generation: The process of taking an AST and turning it into executable code. This part varies greatly depending on the language, the platform it’s targeting, and so on.</li></ul><p>The JavaScript engine is vastly more complex than just those three steps, as are most other language compilers. For instance, in the process of parsing and code-generation, there are certain steps to optimize the performance of the execution, including collapsing redundant elements, etc.</p><p>The JS compiler will take the program var a = 2; and compile it first, and then be ready to execute it, usually right away.</p><ul><li>Engine: Responsible for start-to-finish compilation and execution of our JavaScript program.</li><li>Compiler: One of Engine’s friends; handles all the dirty work of parsing and code-generation (see the previous section).</li><li>Scope: Another friend of Engine; collects and maintains a look-up list of all the declared identifiers (variables), and enforces a strict set of rules as to how these are accessible to currently executing code.</li></ul><h4>Scope lookups</h4><p>When Engine executes the code that Compiler produced for step 2, it has to look up the variable a to see if it has been declared, and this look-up is consulting Scope. But the type of look-up the Engine performs affects the outcome of the look-up. In our case, it is said that the Engine would be performing an LHS lookup for the variable a. The other type of look-up is called RHS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/878063c4d560a6ce26f5ea9b88b568cc/href">https://medium.com/media/878063c4d560a6ce26f5ea9b88b568cc/href</a></iframe><p>Let’s imagine the above exchange (which processes this code snippet) as a conversation. The conversation would go a little something like this:</p><blockquote><em>Engine: Hey Scope, I have an RHS reference for </em><em>foo. Ever heard of it?<br>Scope: Why yes, I have. The compiler declared it just a second ago. It&#39;s a function. Here you go.<br>Engine: Great, thanks! OK, I&#39;m executing </em><em>foo.<br>Engine: Hey, Scope, I&#39;ve got an LHS reference for </em><em>a, ever heard of it?<br>Scope: Why yes, I have. Compiler declared it as a formal parameter to </em><em>foo just recently. Here you go.<br>Engine: Helpful as always, Scope. Thanks again. Now, time to assign </em><em>2 to </em><em>a.<br>Engine: Hey, Scope, sorry to bother you again. I need an RHS lookup for the </em><em>console. Ever heard of it?<br>Scope: No problem, Engine, this is what I do all day. Yes, I&#39;ve got the </em><em>console. It&#39;s built-in. Here ya go.<br>Engine: Perfect. Looking up log(..). OK, great, it&#39;s a function.<br>Engine: Yo, Scope. Can you help me out with an RHS reference to </em><em>a. I think I remember it, but just want to double-check.<br>Scope: You&#39;re right, Engine. The same variable hasn&#39;t changed. Here ya go.<br>Engine: Cool. Passing the value of </em><em>a, which is 2, into log(..).</em></blockquote><p>In summary: In the execution phase, the Engine performs two types of variable lookups — LHS and RHS. LHS lookups occur when values are being assigned to variables, as in the var a = 2; example. RHS lookups occur when retrieving the values of variables. Eg when you console.log(a) and, the Engine needs to look up the value of a.</p><p><em>Q: Check your understanding so far. Make sure to play the part of Engine and have a “conversation” with Scope:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d939be989443b56e3cc093d677da6482/href">https://medium.com/media/d939be989443b56e3cc093d677da6482/href</a></iframe><ol><li>Identify all the LHS look-ups (there are 3!).</li><li>Identify all the RHS look-ups (there are 4!).</li></ol><p><em>Note: Just as a block or function is nested inside another block or function, scopes are nested inside other scopes. So, if a variable cannot be found in the immediate scope, the Engine consults the next outer containing scope, continuing until is found or until the outermost (a.k.a., global) scope has been reached.</em></p><ul><li>Unfulfilled RHS references result in ReferenceErrors being thrown.</li><li>Unfulfilled LHS references result in an automatic, implicitly created global of that name (if not in Strict Mode), or a ReferenceError (if in Strict Mode).</li></ul><h3>Chapter 2 — What is Lexical Scope?</h3><p>There are two main scope models used in different programming languages — lexical and dynamic. <strong>Lexical scope is what’s used in JavaScript.</strong> Lexical scoping (sometimes known as static scoping) is a convention used in many programming languages that sets the scope (range of functionality) of a variable so that it may only be called (referenced) from within the block of code in which it is defined. The scope is determined when the code is compiled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*YBpqpdo4x3C0vSRl" /></figure><ul><li>Bubble 1 encompasses the global scope and has just one identifier in it: foo.</li><li>Bubble 2 encompasses the scope of foo, which includes the three identifiers: a, bar, and b.</li><li>Bubble 3 encompasses the scope of bar, and it includes just one identifier: c.</li></ul><p>Scope bubbles are defined by where the blocks of scope are written, which one is nested inside the other, etc.</p><p>Scope look-up stops once it finds the first match. The same identifier name can be specified at multiple layers of nested scope, which is called “shadowing” (the inner identifier “shadows” the outer identifier). Regardless of shadowing, scope look-up always starts at the innermost scope being executed at the time, works its way outward/upward until the first match, and stops.</p><p>The lexical scope look-up process only applies to first-class identifiers, such as the a, b, and c. If you had a reference to foo.bar.baz in a piece of code, the lexical scope look-up would apply to finding the foo identifier, but once it locates that variable, object property-access rules take over to resolve the bar and baz properties, respectively.</p><h4>Ways to cheat Lexical scope?</h4><p><em>cheating lexical scope leads to poorer performance</em></p><p>eval: The eval(..) function in JavaScript takes a string as an argument and treats the contents of the string as if it had actually been authored code at that point in the program. It can modify existing lexical scope (at runtime) by evaluating a string of “code” that has one or more declarations in it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac9c72ea49f1e4db3a933cd773feab9f/href">https://medium.com/media/ac9c72ea49f1e4db3a933cd773feab9f/href</a></iframe><p>The string “var b = 3;” is treated, at the point of the eval(..) call, as code that was there all along. Because that code happens to declare a new variable b, it modifies the existing lexical scope of foo(..). In fact, as mentioned earlier, this code actually creates variable b inside of foo(..) that shadows the b that was declared in the outer (global) scope. When the console.log(..) call occurs, it finds both a and b in the scope of foo(..), and never finds the outer b. Thus, we print out “1, 3” instead of “1, 2” as would have normally been the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*cRFCwxTI0fLcwMcBa1t_vw.jpeg" /></figure><p>with: The other frowned-upon (and now deprecated!) feature in JavaScript that cheats lexical scope is with the keyword. It essentially creates a whole new lexical scope (again, at run-time) by treating an object reference as a scope and that object’s properties as scoped identifiers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e54b0ce2e7370711a3f074fca1874bd/href">https://medium.com/media/2e54b0ce2e7370711a3f074fca1874bd/href</a></iframe><p>The JavaScript engine has a number of performance optimizations that it performs during the compilation phase. Some of these boil down to being able to essentially statically analyze the code as it lexes, and pre‐determine where all the variable and function declarations are so that it takes less effort to resolve identifiers during execution. But if the engine finds an eval(..) or within the code, it essentially has to assume that all its awareness of identifier location may be invalid, because it cannot know at the lexing time exactly what code you may pass to eval(..) to modify the lexical scope or the contents of the object you may pass to with to create a new lexical scope to be consulted. In other words, in the pessimistic sense, most of those optimizations it would make are pointless if eval(..) or with are present, so it simply doesn’t perform the optimizations at all.</p><h3>Chapter 3 — Function v/s Block Scope?</h3><p>JavaScript has function-based scope. That is, each function you declare creates a bubble for itself, but no other structures create their own scope bubbles. As we’ll see in just a little bit, this is not quite true.</p><p>Let’s explore function scope and its implications.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c5633325a94d55475dc85e9758dc139/href">https://medium.com/media/1c5633325a94d55475dc85e9758dc139/href</a></iframe><ul><li>In this snippet, the scope bubble for foo(..) includes identifiers a, b, c, and bar. It doesn’t matter where in the scope a declaration appears, the variable or function belongs to the containing scope bubble, regardless.</li><li>bar(..) has its own scope bubble. So does the global scope, which has just one identifier attached to it: foo.</li><li>Because a, b, c, and bar all belong to the scope bubble of foo(..), they are not accessible outside of foo(..). That is, the following code would all result in ReferenceError errors, as the identifiers are not available to the global scope:</li></ul><pre>bar(); // fails <br>console.log( a, b, c ); // all 3 fail</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3da106dfffae6910bb8662f886187ea/href">https://medium.com/media/c3da106dfffae6910bb8662f886187ea/href</a></iframe><p><em>Note: We can “hide” variables and functions by enclosing them in the scope of a function.</em></p><p><strong>But why hide?</strong></p><ul><li>They tend to arise from the software design principle Principle of Least Privilege, also sometimes called Least Authority or Least Exposure. This principle states that in the design of software, such as the API for a module/object, you should expose only what is minimally necessary, and “hide” everything else.</li><li>Another benefit of “hiding” variables and functions inside the scope is to avoid unintended collision between two different identifiers with the same name but different intended usages</li></ul><p>Another option for collision avoidance is the more modern module approach, using any of the various dependency managers.</p><h3>Functions as Scopes</h3><p>We’ve seen that we can take any snippet of code and wrap a function around it, and that effectively “hides” any enclosed variable or function declarations from the outside scope inside that function’s inner scope.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d91268cf3d3c52e6f10ba4c5a80e4449/href">https://medium.com/media/d91268cf3d3c52e6f10ba4c5a80e4449/href</a></iframe><p>The above snippet arises few problems:</p><ul><li>It declared a named-function foo(), which means that the identifier name foo itself “pollutes” the enclosing scope (global, in this case).</li><li>We have to explicitly call the function by name (foo()) so that the wrapped code actually executes.</li></ul><p><em>Any solution to the above problem? IIFE</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0f4598e491e2b4280d1cc3308d169ea/href">https://medium.com/media/b0f4598e491e2b4280d1cc3308d169ea/href</a></iframe><p>Notice that the wrapping function statement starts with (function… as opposed to just function…. While this may seem like a minor detail, it’s actually a major change. Instead of treating the function <strong>Function declaration vs expression</strong></p><p>The easiest way to distinguish declaration vs. expression is the position of the word function in the statement (not just a line, but a distinct statement). If the function is the very first thing in the statement, then it’s a function declaration. Otherwise, it’s a function expression.</p><p><strong>Anonymous function expression</strong>:</p><pre>setTimeout(function () {<br> console.log(“I waited 1 second!”);<br>}, 1000);</pre><p>It has no name identifier on it. Function expressions can be anonymous, but function declarations cannot omit the name-that would be illegal JS grammar.</p><p><strong>Drawbacks of Anonymous function expressions</strong></p><ul><li>Anonymous functions have no useful name to display in stack traces, which can make debugging more difficult.</li><li>Without a name, if the function needs to refer to itself, for recursion, etc., the deprecated arguments. callee reference is unfortunately required. Another example of needing self-reference is when an event handler function wants to unbind itself after it fires.</li><li>Anonymous functions omit a name, which is often helpful in providing more readable/understandable code. A descriptive name helps self-document the code in question.</li></ul><p>Inline function expressions are a powerful and useful-the question of anonymous versus named doesn’t detract from that. Providing a name for your function expression quite effectively addresses all these drawbacks, but has no tangible downsides. The best practice is to always name your function expressions:</p><pre>setTimeout(function timeoutHandler() { // ← Look, I have a name!<br> console.log(“I waited 1 second!”);<br>}, 1000);</pre><h4>IIFE — immediately invoked function expression.</h4><p>Of course, IIFEs don’t need names, necessarily-the most common form of IIFE is to use an anonymous function expression. While certainly less common, naming an IIFE has all the aforementioned benefits over anonymous function expressions, so it’s a good practice to adopt. There are 2 ways to write:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32bc5d54ec0931be63212311d99d3212/href">https://medium.com/media/32bc5d54ec0931be63212311d99d3212/href</a></iframe><h3>Block Scope</h3><p>While functions are the most common unit of scope, there are other ways to define scope. Look at the below snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07f6e48e3a29eeda02dda2b3bb75235d/href">https://medium.com/media/07f6e48e3a29eeda02dda2b3bb75235d/href</a></iframe><p><em>We are using a </em><em>bar variable only in the context of the if statement, so it makes a kind of sense that we would declare it inside the </em><em>if block. However, where we declare variables is not relevant when using </em><em>var, because they will always belong to the enclosing scope. This snippet is essentially fake block-scoping, for stylistic reasons, and relying on self-enforcement not to accidentally use </em><em>bar in another place in that scope.</em></p><p>There is a way to create a Block scope that won’t pollute the global scope: let &amp; const. catch also creates block scope in the try-catch statement.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c504eb3e79e42087069a1ca2c323c39c/href">https://medium.com/media/c504eb3e79e42087069a1ca2c323c39c/href</a></iframe><p>However, declarations made with let will not hoist to the entire scope of the block they appear in. Such declarations will not observably “exist” in the block until the declaration statement.</p><pre>{ <br> console.log(bar); // Reference Error! <br> let bar = 2; <br>} // more on it in next chapter</pre><p>Another reason block-scoping is useful relates to closures and garbage collection to reclaim memory.</p><h3>Chapter 4 — Hoisting?</h3><p>There’s a temptation to think that all of the code you see in a JavaScript program is interpreted line-by-line, top-down in order, as the program executes. While that is substantially true, there’s one part of that assumption that can lead to incorrect thinking about your program.</p><p>Look at the below code,</p><pre>a = 2;<br>var a;<br>console.log( a );</pre><p>What do you expect to be printed in the console.log(..) statement? Many developers would expect undefined since the var a statement comes after a = 2; and it would seem natural to assume that the variable is redefined and thus assigned the default undefined. However, the output will be 2.</p><p>Consider another piece of code:</p><pre>console.log( a );<br>var a = 2;</pre><p>You might be tempted to assume that, since the previous snippet exhibited some less-than-top-down looking behavior, perhaps in this snippet, 2 will also be printed. Others may think that since the a variable is used before it is declared, this must result in a ReferenceError being thrown. Unfortunately, both guesses are incorrect. undefined is the output</p><p>So, what’s going on here? It would appear we have a chicken-and-theegg question. Which comes first, the declaration (“egg”), or the assignment (“chicken”)?</p><p><em>Recall that the engine actually will compile your JavaScript code before it interprets it. Part of the compilation phase was to find and associate all declarations with their appropriate scopes.</em></p><p>So, the best way to think about things is that all declarations, both variables, and functions, are processed first before any part of your code is executed.</p><p><em>Note: Only the declarations themselves are hoisted, while any assignments or other executable logic are left in place. If hoisting were to re-arrange the executable logic of our code, that could wreak havoc.</em></p><p><em>Both function declarations and variable declarations are hoisted. But a subtle detail (that can show up in code with multiple “duplicate” declarations) is that functions are hoisted first, and then variables.</em> Consider the below snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/619c5165bbeca25e86bdaa667eab9f03/href">https://medium.com/media/619c5165bbeca25e86bdaa667eab9f03/href</a></iframe><h3>Chapter 5 — Scope Closure?</h3><p>Closure is all around you in JavaScript, you just have to recognize and embrace it.</p><p>Closures happen as a result of writing code that relies on the lexical scope. They just happen. You do not even really have to intentionally create closures to take advantage of them. Closures are created and used for you all over your code. What you are missing is the proper mental context to recognize, embrace, and leverage closures for your own will. The enlightenment moment should be: oh, closures are already occurring all over my code, I can finally see them now. Understanding closures is like when Neo sees the Matrix for the first time.</p><p><em>Closure is when a function is able to remember and access its lexical scope even when that function is executing outside its lexical scope.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04888bd6fb0573457ad60a18a9e93fd5/href">https://medium.com/media/04888bd6fb0573457ad60a18a9e93fd5/href</a></iframe><p>The function bar() has lexical scope access to the inner scope of foo(). But then, we take bar(), the function itself, and pass it as a value. In this case, we return the function object itself that bar references. After we execute foo(), we assign the value it returned (our inner bar() function) to a variable called baz, and then we actually invoke baz(), which of course is invoking our inner function bar(), just by a different identifier reference. bar() is executed, for sure. But in this case, it&#39;s executed outside of its declared lexical scope. After foo() is executed, normally we would expect that the entirety of the inner scope of foo() would go away, because we know that the engine employs a garbage collector that comes along and frees up memory once it&#39;s no longer in use. Since it would appear that the contents of foo() are no longer in use, it would seem natural that they should be considered gone. But the &quot;magic&quot; of closures does not let this happen. That inner scope is in fact still in use and thus does not go away. Who&#39;s using it? The function bar() itself. By virtue of where it was declared, bar() has a lexical scope closure over that inner scope of foo(), which keeps that scope alive for bar() to reference at any later time. bar() still has a reference to that scope, and that reference is called closure. So, a few microseconds later, when the variable baz is invoked (invoking the inner function we initially labeled bar), it duly has access to author-time lexical scope, so it can access the variable a just as we&#39;d expect. The function is being invoked well outside of its author-time lexical scope. Closure lets the function continue to access the lexical scope it was defined in at author time.</p><p>Whatever facility we use to transport an inner function outside of its lexical scope, it will maintain a scope reference to where it was originally declared, and wherever we execute him, that closure will be exercised.</p><p>Eg:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8450d06a032b6087caae87466268dffa/href">https://medium.com/media/8450d06a032b6087caae87466268dffa/href</a></iframe><p><strong>The real working example we see every day:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eff9cc772b07ffa82078b9ed72855bf5/href">https://medium.com/media/eff9cc772b07ffa82078b9ed72855bf5/href</a></iframe><p>We take an inner function (named timer) and pass it to setTime out(..). But timer has a scope closure over the scope of wait(..), indeed keeping and using a reference to the variable message.</p><p>Essentially whenever and wherever you treat functions (that access their own respective lexical scopes) as first-class values and pass them around, you are likely to see those functions exercising closure. Be the timers, event handlers, Ajax requests, cross window messaging, web workers, or any of the other asynchronous (or synchronous!) tasks, when you pass in a callback function, get ready to sling some closure around!</p><p>Let&#39;s see some more examples:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83114f39004717b7c9742d858ec7c95e/href">https://medium.com/media/83114f39004717b7c9742d858ec7c95e/href</a></iframe><p>Huh?</p><p>First, let’s explain where 6 comes from. The terminating condition of the loop is when i is not &lt;=5. The first time that’s the case is when i is 6. So, the output is reflecting the final value of the i after the loop terminates. This actually seems obvious at second glance. The timeout function callbacks are all running well after the completion of the loop. In fact, as timers go, even if it was setTimeout(.., 0) on each iteration, all those function callbacks would still run strictly after the completion of the loop, and thus print 6 each time.</p><p>What’s missing is that we are trying to imply that each iteration of the loop “captures” its own copy of i, at the time of the iteration. But, the way scope works, all five of those functions, though they are defined separately in each loop iteration, are closed over the same shared global scope, which has, in fact, only one i in it.</p><p>How to fix this?</p><p>We learned in Chapter 3 that the IIFE creates scope by declaring a function and immediately executing it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/623e850b1bb647b30935b9ebb7f0eee7/href">https://medium.com/media/623e850b1bb647b30935b9ebb7f0eee7/href</a></iframe><p>Does that work? No… But why?</p><p>We now obviously have more lexical scope. Each timeout function callback is indeed closing over its own per-iteration scope created respectively by each IIFE. It’s not enough to have a scope to close over if that scope is empty. Look closely. Our IIFE is just an empty do-nothing scope. It needs something in it to be useful to us. It needs its own variable, with a copy of the i value at each iteration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79d91644655efc920c364988cb8a9615/href">https://medium.com/media/79d91644655efc920c364988cb8a9615/href</a></iframe><p>We used IIFE to create new scope per iteration. So, we actually needed a per-iteration block scope and we have heard something about let.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/211018deb773399f2fa5661d7060382d/href">https://medium.com/media/211018deb773399f2fa5661d7060382d/href</a></iframe><h3>Modules</h3><p>There are other code patterns that leverage the power of closure but that do not on the surface appear to be about callbacks. Let’s examine the most powerful of them: the module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6a29ad829733099ab5b6b9adcc40cf9/href">https://medium.com/media/d6a29ad829733099ab5b6b9adcc40cf9/href</a></iframe><p>As this code stands right now, there’s no observable closure going on. We simply have some private data variables something and another, and a couple of inner functions doSomething() and doAnother(), which both have a lexical scope (and thus closure!) over the inner scope of foo().</p><p>But now consider:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68efcafeca34c0fc9589211a4f0854b7/href">https://medium.com/media/68efcafeca34c0fc9589211a4f0854b7/href</a></iframe><p>This is the pattern in JavaScript we call module. The most common way of implementing the module pattern is often called revealing module, and it’s the variation we present here. Let’s examine some things about this code.</p><ul><li>First, CoolModule() is just a function, but it has to be invoked for there to be a module instance created. Without the execution of the outer function, the creation of the inner scope and the closures would not occur.</li><li>Second, the CoolModule() function returns an object, denoted by the object-literal syntax { key: value, … }. The object we return has references on it to our inner functions, but not to our inner data variables. We keep those hidden and private. It’s appropriate to think of this object return value as essentially a public API for our module. This object return value is ultimately assigned to the outer variable foo, and then we can access those property methods on the API, like foo.doSomething().</li><li>The doSomething() and doAnother() functions have closure over the inner scope of the module instance (arrived at by actually invoking CoolModule()). When we transport those functions outside of the lexical scope, by way of property references on the object we return, we have now set up a condition by which closure can be observed and exercised.</li></ul><p><strong>Requirements for the module pattern to be exercised:</strong></p><ol><li>There must be an outer enclosing function, and it must be invoked at least once (each time creates a new module instance).</li><li>The enclosing function must return back at least one inner function, so that this inner function has closure over the private scope, and can access and/or modify that private state.</li></ol><p>Converting a Module into IIFE, so that there is no need to create a new module instance every time:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bec821598388fd01126f93724624758/href">https://medium.com/media/5bec821598388fd01126f93724624758/href</a></iframe><p>ES6 adds first-class syntax support for the concept of modules. When loaded via the module system, ES6 treats a file as a separate module. Each module can both import other modules or specific API members, as well as export their own public API members. ES6 modules do not have an “inline” format, they must be defined in separate files (one per module). The browsers/engines have a default “module loader” (which is overridable, but that’s well beyond our discussion here), which synchronously loads a module file when it’s imported.</p><p>Consider:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bddf08a3fa5f14e4acf8377044445f0/href">https://medium.com/media/8bddf08a3fa5f14e4acf8377044445f0/href</a></iframe><h3>Appendix A — Dynamic Scope</h3><p>Lexical scope is the set of rules about how the engine can look up a variable and where it will find it. The key characteristic of lexical scope is that it is defined at author’s time when the code is written (assuming you don’t cheat with eval() or with). Dynamic scope seems to imply, and for good reason, that there’s a model whereby scope can be determined dynamically at runtime, rather than statically at author time.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e70f84c812ae57313e981dc06f8b2a9a/href">https://medium.com/media/e70f84c812ae57313e981dc06f8b2a9a/href</a></iframe><p><em>Lexical scope holds that the RHS reference to </em><em>a in foo() will be resolved to the global variable a, which will result in value 2 being output.</em></p><p>Dynamic scope, by contrast, doesn’t concern itself with how and where functions and scopes are declared, but rather where they are called from. In other words, the scope chain is based on the call stack, not the nesting of scopes in code.</p><p>So, if JavaScript had dynamic scope, when foo() is executed, theoretically the code below would instead result in 3 as the output.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0670e5be8c9a61d6aa066ee808738410/href">https://medium.com/media/0670e5be8c9a61d6aa066ee808738410/href</a></iframe><p>How can this be? Because when foo() cannot resolve the variable reference for a, instead of stepping up the nested (lexical) scope chain, it walks up the call stack, to find where foo() was called from. Since foo() was called from bar(), it checks the variables in scope for bar(), and finds an a there with value 3. Strange? You&#39;re probably thinking so, at the moment. But that&#39;s just because you&#39;ve probably only ever worked on (or at least deeply considered) code that is lexically scoped. So dynamic scoping seems foreign. If you had only ever written code in a dynamically scoped language, it would seem natural, and lexical scope would be the oddball. To be clear, <strong><em>JavaScript does not, in fact, have dynamic scope. It has lexical scope.</em></strong> Plain and simple. But this mechanism is kind of like dynamic scope.</p><h3>Appendix B — Polyfilling Block Scope</h3><p>What if we wanted to use block scope in pre-ES6 environments?</p><pre>{<br> let a = 2;<br> console.log(a); // 2<br>}<br>console.log( a ); // ReferenceError</pre><p>Basically alternative for pre-es6?</p><pre>try { throw 2 } catch (a) {<br> console.log(a); // 2<br>}<br>console.log(a); // ReferenceError<br>// Ugly code</pre><p><em>Note: Google maintains a project called Traceur, which is exactly tasked with transpiling ES6 features into pre-ES6 (mostly ES5, but not all!) for general usage.</em></p><p>That’s all folks for today, Very soon I will be writing another blog for the next book in the series</p><p>Want an even shorter version of this? Check out below:</p><p><a href="https://medium.com/@amesimmons/you-dont-know-js-my-learnings-from-scope-closures-d228002b781d">You Don’t Know JS: My learnings from Scope &amp; Closures</a></p><p>Open to feedback and comments if I missed any concept which was covered in this book.</p><p>🙏 Credit:</p><p><a href="https://github.com/getify/You-Dont-Know-JS">GitHub - getify/You-Dont-Know-JS: A book series (2 published editions) on the JS language.</a></p><p><em>Originally published at </em><a href="https://alok722.hashnode.dev/ydkjs-scope-and-closures-takeaways-for-experienced-javascript-developer"><em>https://alok722.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d571eee5e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Become React Developer In 2021 From Youtube]]></title>
            <link>https://alok722.medium.com/how-to-become-react-developer-in-2021-from-youtube-c468d19e8059?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c468d19e8059</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Sun, 25 Jul 2021 15:37:23 GMT</pubDate>
            <atom:updated>2021-07-25T15:37:23.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1lvaXoLZyfl62Zuy" /><figcaption>React Roadmap</figcaption></figure><p>A roadmap to becoming react developer from scratch for free for complete beginners to web development.</p><p>The courses listed below are my personal preference and have experienced myself. There are other great series available on YouTube, but these courses listed below are something that would be my personal recommendation to beginners.</p><p>Now. let’s see the list of series to be followed in order.</p><pre><strong>Step 1: Learn Git &amp; GitHub<br>Step 2: Learn HTML<br>Step 3: Learn CSS, Bootstrap &amp; SCSS<br>Step 4: Learn Javascript<br>Step 5: Learn React<br>Step 6: Learn Redux</strong></pre><pre><strong>// 🏆 Congratulations, you are now a React developer.</strong></pre><h3>Git &amp; GitHub</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3RjQznt-8kE%3Flist%3DPL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3RjQznt-8kE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3RjQznt-8kE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a29ffc7966b20d4c95a4c0c9f75597b7/href">https://medium.com/media/a29ffc7966b20d4c95a4c0c9f75597b7/href</a></iframe><h3>HTML</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUB1O30fR-EE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUB1O30fR-EE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUB1O30fR-EE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a5d4837d213eb4f0c233eb3519286d3/href">https://medium.com/media/7a5d4837d213eb4f0c233eb3519286d3/href</a></iframe><h3>CSS, Bootstrap &amp; SCSS</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyfoY53QXEnI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyfoY53QXEnI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyfoY53QXEnI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/77da2bb2f8f23331bdec580974326cc1/href">https://medium.com/media/77da2bb2f8f23331bdec580974326cc1/href</a></iframe><p>Before moving to <strong>Bootstrap &amp; SCSS</strong>, you can quickly revise the learned concept by following the below series.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fhu-q2zYwEYs%3Flist%3DPL4cUxeGkcC9ivBf_eKCPIAYXWzLlPAm6G&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dhu-q2zYwEYs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fhu-q2zYwEYs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/36f8786dd7841a3b750f79049dde3e6a/href">https://medium.com/media/36f8786dd7841a3b750f79049dde3e6a/href</a></iframe><p>Now move along, 😃</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrQryOSyfXmI%3Flist%3DPLl1gkwYU90QlfX9oIJvC4JJKaucei7Hx8&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrQryOSyfXmI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrQryOSyfXmI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccc97678c0b265576ee4a752b3fca74a/href">https://medium.com/media/ccc97678c0b265576ee4a752b3fca74a/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfYq5PXgSsbE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfYq5PXgSsbE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfYq5PXgSsbE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/84e9a86dd276d969c629e0ba18ca2e00/href">https://medium.com/media/84e9a86dd276d969c629e0ba18ca2e00/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZz6eOVaaelI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZz6eOVaaelI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZz6eOVaaelI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bfc4eae2105f6b0f1632fc8806889886/href">https://medium.com/media/bfc4eae2105f6b0f1632fc8806889886/href</a></iframe><h3>Javascript</h3><p>There is a lot of series to follow in this section but it’s important as Javascript is the Pillars. Please follow the series in order, focus more on <strong>Javascript Basics</strong>, <strong>Modern Javascript</strong> &amp; <strong>Asynchronous JavaScript</strong>.</p><p><a href="https://javascript.info/">The Modern JavaScript Tutorial</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqoSksQ4s_hg%3Flist%3DPL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqoSksQ4s_hg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqoSksQ4s_hg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e3f03413719fbc15a2276db77eca5ed/href">https://medium.com/media/9e3f03413719fbc15a2276db77eca5ed/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnZ1DMMsyVyI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnZ1DMMsyVyI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnZ1DMMsyVyI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/63a390be15a287c316305786bab549b9/href">https://medium.com/media/63a390be15a287c316305786bab549b9/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FR8rmfD9Y5-c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DR8rmfD9Y5-c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FR8rmfD9Y5-c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/56c80a64ef6f74a27ffa7d93034724b6/href">https://medium.com/media/56c80a64ef6f74a27ffa7d93034724b6/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVRz0nbax0uI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVRz0nbax0uI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVRz0nbax0uI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e0b5604b8ffbf6037d71691d7fda614/href">https://medium.com/media/8e0b5604b8ffbf6037d71691d7fda614/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfBpPfPjxOhc&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfBpPfPjxOhc&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FfBpPfPjxOhc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/353e1ed1157943a6da724a13d6077090/href">https://medium.com/media/353e1ed1157943a6da724a13d6077090/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPFmuCDHHpwk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPFmuCDHHpwk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPFmuCDHHpwk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/25f5de2a7cd74db105f728631b9e8e72/href">https://medium.com/media/25f5de2a7cd74db105f728631b9e8e72/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9XRufzemZNc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9XRufzemZNc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9XRufzemZNc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/51c43258b8dd5f383ca084bdee7d0afe/href">https://medium.com/media/51c43258b8dd5f383ca084bdee7d0afe/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZcQyJ-gxke0%3Flist%3DPL4cUxeGkcC9jx2TTZk3IGWKSbtugYdrlu&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZcQyJ-gxke0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZcQyJ-gxke0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/efd0b251fb40e50915c8d20141203c3d/href">https://medium.com/media/efd0b251fb40e50915c8d20141203c3d/href</a></iframe><p>An optional series to follow, which you can skip for the moment but this course is something which you must complete before appearing for any interview.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpN6jk0uUrD8%3Flist%3DPLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpN6jk0uUrD8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FpN6jk0uUrD8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/786745d4efd6d7a2694330a5d5956a62/href">https://medium.com/media/786745d4efd6d7a2694330a5d5956a62/href</a></iframe><h3>React</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQFaFIcGhPoM%3Flist%3DPLC3y8-rFHvwgg3vaYJgHGnModB54rxOk3&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQFaFIcGhPoM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQFaFIcGhPoM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9cc00d5cdc82bcb76a5f00af584bbb57/href">https://medium.com/media/9cc00d5cdc82bcb76a5f00af584bbb57/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLaw7wfdg_ls%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLaw7wfdg_ls&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLaw7wfdg_ls%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bec70d0e876775979e6823da90415b15/href">https://medium.com/media/bec70d0e876775979e6823da90415b15/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5ZFK_5V8VpI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5ZFK_5V8VpI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5ZFK_5V8VpI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cd0bab0cb04bc651691b60c2acac959/href">https://medium.com/media/5cd0bab0cb04bc651691b60c2acac959/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FY0-qdp-XBJg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DY0-qdp-XBJg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FY0-qdp-XBJg%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f90186b0721030eff68dd4b38b033300/href">https://medium.com/media/f90186b0721030eff68dd4b38b033300/href</a></iframe><h3>Redux</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9boMnm5X9ak%3Flist%3DPLC3y8-rFHvwheJHvseC3I0HuYI2f46oAK&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9boMnm5X9ak&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9boMnm5X9ak%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3aa159bb074163f6d4efc4e5d7930c52/href">https://medium.com/media/3aa159bb074163f6d4efc4e5d7930c52/href</a></iframe><h3>React Unit Testing</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZmVBCpefQe8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZmVBCpefQe8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZmVBCpefQe8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/072afd09daf033f99bdf910b155cbacd/href">https://medium.com/media/072afd09daf033f99bdf910b155cbacd/href</a></iframe><p>Most of the courses listed above are series so make sure you are opening every video on YouTube directly.</p><p>Now I think you are ready to explore around and understand the bigger picture of React. Watch the Roadmap embedded below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ni319HfwNcpO2-p4QLzZaQ.png" /><figcaption><a href="https://roadmap.sh/react">https://roadmap.sh/react</a></figcaption></figure><p>Good Luck</p><p>Reach out to me on <a href="https://linkedin.com/in/alok722">LinkedIn</a></p><p><em>Originally published at </em><a href="https://alok722.hashnode.dev/how-to-become-react-developer-in-2021-from-youtube"><em>https://alok722.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c468d19e8059" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YDKJS — UP & GOING, Takeaways for Experienced JavaScript Developer]]></title>
            <link>https://alok722.medium.com/ydkjs-up-going-takeaways-for-experienced-javascript-developer-ccda83b38a6a?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccda83b38a6a</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[this]]></category>
            <category><![CDATA[closure]]></category>
            <category><![CDATA[ydkjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Thu, 15 Jul 2021 15:14:38 GMT</pubDate>
            <atom:updated>2022-06-10T10:59:17.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>YDKJS — UP &amp; GOING, Takeaways for Experienced JavaScript Developer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wHTFw4WLMaIR8mE6ErHtw.png" /></figure><p>These are a few of the important takeaways from Kyle Simpson’s <strong>YDKJS — UP &amp; GOING</strong> book series.</p><ul><li>The JavaScript you know right now is probably parts handed down to you by others who’ve been burned by incomplete understanding. That JavaScript is but a shadow of the true language. You don’t really know JavaScript, yet, but if you dig into this series, you will. Read on, my friends. JavaScript awaits you.</li><li>It’s typically asserted that JavaScript is interpreted because your JavaScript source code is processed each time it’s run. But that’s not entirely accurate. The JavaScript engine actually compiles the program on the fly and then immediately runs the compiled code.</li><li>Comments should explain why not what. They can optionally explain how if that’s particularly confusing.</li><li>The return value from the typeof operator is always one of six (seven as of ES6! — the “symbol” type) string values. That is, typeof “abc” returns “string”, not string.</li></ul><pre>typeof array; // “object” arrays are special objects <br>typeof null; // “object” — weird, bug</pre><ul><li>The specific list of “falsy” values in JavaScript is as follows:</li></ul><pre><em>“” (empty string)<br>0, -0, NaN (invalid number)<br>null, undefined<br>false</em></pre><ul><li>Any value that’s not on this “falsy” list is “truthy.” Here are some examples of those:</li></ul><h3>Equality</h3><p>The difference between == and === is usually characterized that == checks for value equality and === checks for both values and type equality. However, this is inaccurate. The proper way to characterize them is that == checks for value equality with coercion allowed, and === checks for value equality without allowing coercion; === is often called &quot;strict equality&quot; for this reason.</p><p>Consider the implicit coercion that’s allowed by the == loose-equality comparison and not allowed with the === strict-equality:</p><pre>var a = “42”;<br>var b = 42;</pre><pre>a == b; // true<br>a === b; // false</pre><p>In the a == b comparison, JS notices that the types do not match, so it goes through an ordered series of steps to coerce one or both values to a different type until the types match, where then simple value equality can be checked.</p><p>If you think about it, there are two possible ways a == b could give true via coercion. Either the comparison could end up as 42 == 42 or it could be &quot;42&quot; == &quot;42&quot;. So which is it?</p><p>The answer: &quot;42&quot; becomes 42, to make the comparison 42 == 42. In such a simple example, it doesn&#39;t really seem to matter which way that process goes, as the end result is the same. There are more complex cases where it matters not just what the end result of the comparison is but <em>how</em> you get there.</p><p>The a === b produces false, because the coercion is not allowed, so the simple value comparison obviously fails. Many developers feel that === is more predictable, so they advocate always using that form and staying away from ==. I think this view is very shortsighted. I believe == is a powerful tool that helps your program, <em>if you take the time to learn how it works.</em></p><p>To boil down a whole lot of details to a few simple takeaways, and help you know whether to use == or === in various situations, here are my simple rules:</p><ul><li>If either value (aka side) in comparison could be the true or false value, avoid == and use ===.</li><li>If either value in comparison could be one of these specific values (0, &quot;&quot;, or [] -- empty array), avoid == and use ===.</li><li>In <em>all</em> other cases, you’re safe to use ==. Not only is it safe, but in many cases, it simplifies your code in a way that improves readability.</li></ul><p>You should take special note of the == and === comparison rules if you&#39;re comparing two non-primitive values, like objects (including function and array). Because those values are actually held by reference, both == and === comparisons will simply check whether the references match, not anything about the underlying values.</p><p>For example, arrays are by default coerced to strings by simply joining all the values with commas (,) in between. You might think that two arrays with the same contents would be == equal, but they&#39;re not:</p><pre>var a = [1,2,3];<br>var b = [1,2,3];<br>var c = “1,2,3”;</pre><pre>a == c; // true<br>b == c; // true<br>a == b; // false</pre><h3>Hoisting</h3><p>Wherever a var appears inside a scope, that declaration is taken to belong to the entire scope and accessible everywhere throughout. Metaphorically, this behavior is called <em>hoisting</em>, when a var the declaration is conceptually &quot;moved&quot; to the top of its enclosing scope. Technically, this process is more accurately explained by how code is compiled, but we can skip over those details for now.</p><p>Consider:</p><pre>var a = 2;</pre><pre>foo(); // works because `foo()`<br> // declaration is “hoisted”</pre><pre>function foo() {<br> a = 3;</pre><pre>console.log( a ); // 3</pre><pre>var a; // declaration is “hoisted”<br> // to the top of `foo()`<br>}</pre><pre>console.log( a ); // 2</pre><h3>Closure</h3><p>You can think of closure as a way to “remember” and continue to access a function’s scope (its variables) even once the function has finished running.</p><p>Consider:</p><pre>function makeAdder(x) {<br> // parameter `x` is an inner variable</pre><pre>// inner function `add()` uses `x`, so<br> // it has a “closure” over it<br> function add(y) {<br> return y + x;<br> };</pre><pre>return add;<br>}</pre><p>The reference to the inner add(..) function that gets returned with each call to the outer makeAdder(..) is able to remember whatever x value was passed in to makeAdder(..).</p><h3>this Identifier</h3><p>Another very commonly misunderstood concept in JavaScript is the this identifier. Again, there&#39;s a couple of chapters on it in the <em>this &amp; Object Prototypes</em> title of this series, so here we&#39;ll just briefly introduce the concept.</p><p>While it may often seem that this is related to &quot;object-oriented patterns,&quot; in JS this is a different mechanism.</p><p>If a function has a this reference inside it, that this reference usually points to an object. But which object it points to depends on how the function was called.</p><p>It’s important to realize that this <em>does not</em> refer to the function itself, as is the most common misconception.</p><p>Here’s a quick illustration:</p><pre>function foo() {<br> console.log( this.bar );<br>}</pre><pre>var bar = “global”;</pre><pre>var obj1 = {<br> bar: “obj1”,<br> foo: foo<br>};</pre><pre>var obj2 = {<br> bar: “obj2”<br>};</pre><pre>// — — — — </pre><pre>foo(); // “global”<br>obj1.foo(); // “obj1”<br>foo.call( obj2 ); // “obj2”<br>new foo(); // undefined</pre><p>There are four rules for how this gets set, and they&#39;re shown in those last four lines of that snippet.</p><ol><li>foo() ends up setting this to the global object in non-strict mode -- in strict mode, this would be undefined and you&#39;d get an error in accessing the bar property -- so &quot;global&quot; is the value found for this.bar.</li><li>obj1.foo() sets this to the obj1 object.</li><li>foo.call(obj2) sets this to the obj2 object.</li><li>new foo() sets this to a brand new empty object.</li></ol><p>Bottom line: to understand what this points to, you have to examine how the function in question was called. It will be one of those four ways just shown, and that will then answer what this is.</p><h3>Prototypes</h3><p>When you reference a property on an object, if that property doesn’t exist, JavaScript will automatically use that object’s internal prototype reference to find another object to look for the property on. You could think of this almost as a fallback if the property is missing.</p><p>The internal prototype reference linkage from one object to its fallback happens at the time the object is created. The simplest way to illustrate it is with a built-in utility called Object.create(..).</p><p>Consider:</p><pre>var foo = {<br>    a: 42<br>};</pre><pre>// create `bar` and link it to `foo`<br>var bar = Object.create( foo );</pre><pre>bar.b = &quot;hello world&quot;;</pre><pre>bar.b;        // &quot;hello world&quot;<br>bar.a;        // 42 &lt;-- delegated to `foo`</pre><p>The a property doesn&#39;t actually exist on the bar object, but because bar is prototype-linked to foo, JavaScript automatically falls back to looking for a on the foo object, where it&#39;s found.</p><p>This linkage may seem like a strange feature of the language. The most common way this feature is used — and I would argue, abused — is to try to emulate/fake a “class” mechanism with “inheritance.”</p><p>But a more natural way of applying prototypes is a pattern called “behavior delegation,” where you intentionally design your linked objects to be able to <em>delegate</em> from one to the other for parts of the needed behavior.</p><h3>Non-JavaScript</h3><p>So far, the only things we’ve covered are in the JS language itself. The reality is that most JS is written to run in and interact with environments like browsers. A good chunk of the stuff that you write in your code is, strictly speaking, not directly controlled by JavaScript. That probably sounds a little strange.</p><p>The most common non-JavaScript JavaScript you’ll encounter is the DOM API. For example:</p><pre>var el = document.getElementById( &quot;foo&quot; );</pre><p>The document variable exists as a global variable when your code is running in a browser. It&#39;s not provided by the JS engine, nor is it particularly controlled by the JavaScript specification. It takes the form of something that looks an awful lot like a normal JS object, but it&#39;s not really exactly that. It&#39;s a special object, often called a &quot;host object.&quot;</p><p>Moreover, the getElementById(..) method on document looks like a normal JS function, but it&#39;s just a thinly exposed interface to a built-in method provided by the DOM from your browser. In some (newer-generation) browsers, this layer may also be in JS, but traditionally the DOM and its behavior are implemented in something more like C/C++.</p><p>Another example is input/output (I/O).</p><p>Everyone’s favorite alert(..) pops up a message box in the user&#39;s browser window. alert(..) is provided to your JS program by the browser, not by the JS engine itself. The call you make sends the message to the browser internals and it handles drawing and displaying the message box.</p><p>The same goes with console.log(..); your browser provides such mechanisms and hooks them up to the developer tools.</p><p>That’s all folks for today, Very soon I will be writing another blog for the next book in the series i.e. <em>SCOPE &amp; CLOSURE</em>.</p><p>Want an even shorter version of this? Check out below:</p><p><a href="https://medium.com/@amesimmons/you-dont-know-js-my-learnings-from-up-going-5014fc778efb">You Don’t Know JS: My learnings from Up &amp; Going</a></p><p>Open to feedback and comments if I missed any concept which was covered in this book.</p><p>🙏 Credit:</p><p><a href="https://github.com/getify/You-Dont-Know-JS">GitHub - getify/You-Dont-Know-JS: A book series (2 published editions) on the JS language.</a></p><p><em>Originally published at </em><a href="https://alok722.hashnode.dev/ydkjs-up-and-going-takeaways-for-experienced-javascript-developer"><em>https://alok722.hashnode.dev</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccda83b38a6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Story of Transition to the Senior SE role]]></title>
            <link>https://alok722.medium.com/story-of-transition-to-the-senior-se-role-2c6ea1101e4a?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c6ea1101e4a</guid>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Mon, 04 Jan 2021 08:10:16 GMT</pubDate>
            <atom:updated>2024-07-26T18:26:04.549Z</atom:updated>
            <content:encoded><![CDATA[<p>TLDR; This article focuses on my recent transition to the Senior SE role. I am sharing my experiences and lessons from this transition in hopes that it might help someone else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QXyNfRnmVEWLhFcG" /><figcaption>Photo by <a href="https://unsplash.com/@xangriffin?utm_source=medium&amp;utm_medium=referral">Xan Griffin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://www.linkedin.com/in/akshaymarch7/">Akshay Saini</a>, you must have heard of him. If not, here is a short intro: He is the creator of <a href="https://www.youtube.com/watch?v=pN6jk0uUrD8&amp;list=PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&amp;ab_channel=AkshaySaini">**Namaste Javascript</a>**.</p><p>Now do you remember? No? Then go watch at least one video from the series. I’m sure you will never forget him. He has simplified Javascript’s most complex internal architecture and made it easy for us to understand.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpN6jk0uUrD8%3Flist%3DPLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpN6jk0uUrD8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FpN6jk0uUrD8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/786745d4efd6d7a2694330a5d5956a62/href">https://medium.com/media/786745d4efd6d7a2694330a5d5956a62/href</a></iframe><p>Anyway, 21 days ago, he inspired us to make the most of our time and start the new year fresh. So, I decided to solve at least one problem on LeetCode every day and read the “You Don’t Know JS” book series. But things don’t always go as planned. A few recruiters on LinkedIn approached me with job opportunities, and I thought, why not use these 21 days to get a good job offer?</p><p>So, here’s a quick intro about me: I was a MEAN stack developer with 1.5 years of professional experience and a total of 2.5 years of experience, including internships and freelancing. I am in love with the JavaScript ecosystem, so I constantly explore different frameworks and libraries in this ever-expanding JavaScript world.</p><blockquote><strong>Q:</strong> Did I get a good job offer?<br><strong>A:</strong> Yes, I did; not only did I get a good offer, but I am now going to be a Senior SE with a massive hike.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*IO0G2ygwIml_NGAv26Na4w.gif" /><figcaption>celebrate the moment</figcaption></figure><blockquote><strong>Q:</strong> How I did it even though I am not good at competitive coding?<br><strong>A:</strong> I might not be great at competitive coding, but I excel at building modular, scalable web apps with solid coding standards. I cover unit testing and ensure proper documentation. I focus on these strengths and always strive to improve my skills.</blockquote><h3>I would like to explain my transition to becoming a Senior SE in a few sections.</h3><h3>HARD WORK:</h3><p>Most of us, after office hours, tend to relax or binge-watch Netflix. However, I took a different approach and tried to invest at least 2 hours daily in developing my skills. Additionally, if I was traveling, I would read blogs, or if I had 5–10 minutes before leaving, I would watch short tech-based posts on Instagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*xRdQT8_tGQmyFaoOOOkrbw.gif" /><figcaption>keep putting the hard work</figcaption></figure><h3>PATIENCE:</h3><p>Have patience and believe in yourself because, sooner or later, everything will be fine. Don’t get discouraged; your time will come. Just keep putting in the hard work. I know it’s easy to say, but living it is difficult. However, we don’t have a choice; we have to keep moving and trying if we want good things in life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*JSeKv2KK66iSk21QQJ9YkA.gif" /><figcaption>never lose hope</figcaption></figure><h3>PREPARATION STRATEGY:</h3><p>Even though I managed to get multiple offers in these 21 days, I had been preparing from the very beginning, bit by bit, every day. My preparation strategy was simple and efficient. I first listed all the possible topics related to my skill set. Then, I created to-do lists for each topic and started crossing them off one by one as I became confident in each area, while also making some rough notes.</p><p>Below are the important topics of my skill set that I listed:</p><blockquote><a href="https://html.com/"><strong>HTML</strong></a>: <em>What is HTML, What’s new in HTML5, explain DOCTYPE declaration, Semantic elements in HTML &amp; its advantage, commonly used tags, figure tag, fieldset, srcset attribute, tab index, inline &amp; block level elements, meta tags, iframe &amp; object tags, web workers, graphics -&gt; SVG &amp; canvas, Quirks mode in HTML5, HTML5 Web API, image map, marquee, audio, video, geocode, datalist in form, Persistent Local Storage, Microdata, keygen, difference — Semantic Vs. Non-semantic, Application Cache in HTML5, Manifest file &amp; others</em></blockquote><blockquote><a href="https://www.w3schools.com/css/"><strong>CSS</strong></a>: What is CSS, box model, CSS selectors, pseudo-class &amp; pseudo-element, how does CSS work (under the hood of the browser), the difference between relative, fixed, absolute and static, CSS Specificity, purpose of clearing floats, media query, CSS for print, selector that will match any links end/start/contains, flexbox, CSS grid, reset CSS, normalize CSS, Sass or Less and or Stylus, !important, concept of Tweening, any CSS framework &amp; others. More <a href="https://web.dev/learn/css/"><em>@here</em></a></blockquote><blockquote><a href="https://javascript.info/"><strong>JAVASCRIPT</strong></a>: What is Javascript, Call stack, Primitive types, Value Types &amp; Reference Types, Function scope, Execution context, Block scope &amp; Lexical scope, IIFE, Modules, Namespaces, DOM and Layout Trees, this, call apply &amp; bind, prototype inheritance &amp; prototype chain, Object create &amp; assign, Js array functions, Pure/Impure functions, Closures, High order functions, Promises, Callback, Async/Await, OOPs implementation, time/ execution related functions (setTimeout, setInterval), collections and generators, message queues, hoisting, polyfill, currying, debouncing, async vs defer, event bubbling &amp; capturing, Prototype &amp; Prototypal inheritance, Object prototypes, throttling, recursion, local storage vs session storage, CORS, web storage APIs, event loop, web sockets, “use strict”, eval, babel, pass by reference, pass by value, es6+ ex: spread operator, rest operator, destructuring, arrow function, template string, etc., for loop (for-each, for-of, for-in), AJAX &amp; others. More <a href="https://javascript.info/"><em>@here</em></a></blockquote><blockquote><a href="https://angular.io/"><strong>ANGULAR</strong></a>: What is Angular, basic typescript, angular version changes, features of Angular, angular cli, advantage and disadvantage of angular, how angular work, Ivy, JIT &amp; AOT in angular and its advantage &amp; disadvantage, What are the building blocks of Angular, components, What is Data Binding, string interpolation, property binding, event binding, two way binding, data sharing between components, view encapsulation, view child, directive &amp; its type with example, custom directive, pipe, custom pipe, pure pipe &amp; impure pipe, async pipe, pipe chaining, mvc architecture, mvp architecture, angular routing, lazy loading, loadChildren, angular services, dependency injection, life cycle, ng-content, components vs directives, modules, decorators, internationalization, ng-container vs div, angular on server side, MVVM architecture, auth guard, interceptor, rxjs &amp; its most used operators, promise vs observable, cold observable vs hot observable, ngClass &amp; ngStyle, Angular elements, difference among “declarations”, “providers” and “import” in NgModule, form — reactive &amp; template driven, dynamic form, Transpiling, unit-testing related concepts &amp; others. More <a href="https://angular.dev/overview">@here</a></blockquote><blockquote><a href="https://reactjs.org/"><strong>REACT</strong></a><strong>: </strong>What is React, advantages of React, Component Architecture, Hierarchy, Communication between components, State &amp; Props, props validation, SPA (Simple Page Application) vs MPA (Multi-Page Application), Functional vs Class-based component, Controlled Components, Pure Component how React &amp; virtual DOM works, Higher-Order component, JSX, Life-Cycle Methods, render method, constructor, Hooks &amp; Custom hooks, Routing &amp; lazy loading, what is prop drilling &amp; how to avoid it? State Management (Mostly Redux questions are asked but other libraries like Mobx are there), React clone elements, Strict Mode in React, synthetic events &amp; others. More <a href="https://react.dev/learn"><em>@here</em></a>, <a href="https://reacthandbook.dev/"><em>@here</em></a></blockquote><blockquote><a href="https://nodejs.org/en/"><strong>NODEJS</strong></a>: What is Node.js, If Node.js is single-threaded then how it handles concurrency, benefits of NodeJS, event loop, event queue, Libuv, thread pool, the downside of the single-threaded concept, What is an error-first callback, event emitter, node environment, LTS release of node, reactor pattern in node, time/ execution related functions (setTimeout/clearTimeout, setInterval/clear interval, setImmediate/clear immediate, process.nextTick) where a node is used, Asynchronous &amp; Synchronous, non-blocking” in node.js, REPL, NPM, semantic versioning, child process, fork &amp; spawn, streams in node, fs module, HTTP module, Zlib module, stream module, util module, v8 engine, event-driven programming, package.json, create a simple server in Node.js, the purpose of module exports, buffer class, different types of HTTP requests, put vs patch, cluster, event listeners, Microservice architecture, message queue &amp; Trace, Stream Buffer, Crypto, Security Mechanism &amp; others. More <a href="https://nodejs.org/en/learn/getting-started/introduction-to-nodejs">@here</a></blockquote><blockquote><a href="https://expressjs.com/"><strong>EXPRESSJS</strong></a>: What is express, features of Express JS, steps used to set up an express JS application, arguments available to an Express JS route handler-function, use of next in Express JS, Middleware in Express.js, types of middleware, templating engine, server-side rendered page, error handling &amp; others. More <a href="https://expressjs.com/">@here</a></blockquote><blockquote><a href="https://www.mongodb.com/"><strong>MongoDB </strong></a><strong>&amp; </strong><a href="https://mongoosejs.com/docs/api.html"><strong>MONGOOSE</strong></a>: What is MongoDB, JSON vs BSON, data types supported by Mongo, best features of MongoDB, the difference between SQL or NoSQL, _id Field in MongoDB, create or select a database, collection in Mongo, CRUD operation in Mongo, upsert, write concern, Storage Engine, replica set, journal, profiler, the concept of the foreign key in mongo, sharding, GridFS, update the _id of one MongoDB Document, Does an update fsync to disk immediately, replica set, transactions/locking in MongoDB, ACID property, namespace, Horizontal Scaling &amp; Vertical Scaling, MongoDB aggregation, Indexes in MongoDB, type of index, covered query, rename keys of document, models &amp; schema in mongoose.</blockquote><p>Once I finish listing the topics, I start reading about them online, either on YouTube, Medium, Dev, or the official documentation. I always make sure to understand the topics well enough to explain them to anyone, using various scenarios and real-life examples.</p><blockquote><strong>Q:</strong> What about DSA?<br><strong>A:</strong> No one can avoid DSA, even in a front-end role interview. As Akshay mentioned in many of his videos, you must know basic DSA and how to implement it. So, I made sure to learn most of the DSA topics and their implementation in JavaScript.</blockquote><p>This Udemy course came in very handy and boosted my confidence.<br><a href="https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/">https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*B1nx2CtuKF87_i8xkhembw.gif" /></figure><p>Hold on, a few more points:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*YSRVp8X3xRq54gdaASCyUA.gif" /><figcaption>alright</figcaption></figure><h3><strong>TIPS TO STAND OUT</strong></h3><h4>FIND A GOOD FRIEND</h4><p>A friend whose skill set matches yours is invaluable. As Akshay always says, find your Simran. This is crucial because it speeds up the learning process, and you both get to learn many things in less time. In my case, my mentor/Simran/friend is <a href="https://www.linkedin.com/in/mikr13/">Mihir</a>. We collaborate and work together on side projects, along with our venture, <a href="https://opendevs.in/">open devs</a>, a GitHub organization we created to build cool open-source projects and share what we have learned over the years.</p><h4>WORK ON SIDE PROJECTS</h4><p>This always helps because it allows you to apply the concepts you have learned theoretically. Most importantly, if you have some good projects, you will have plenty to discuss, and the interviewer will have many questions about the projects you are an expert in.</p><h4>ALWAYS KEEP LEARNING</h4><p>There is no end to learning; you must always keep learning and practicing.</p><p><strong>FEW RESOURCES:</strong></p><p>· <a href="https://github.com/sudheerj?tab=repositories">Interview Questions</a></p><p>· <a href="https://www.youtube.com/watch?v=pN6jk0uUrD8&amp;list=PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&amp;ab_channel=AkshaySaini">Namaste Javascript</a></p><p>· <a href="https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/">JavaScript Algorithms and Data Structures Masterclass</a></p><p>· <a href="https://studio3t.com/knowledge-base/articles/mongodb-aggregation-framework">The Beginner’s Guide to MongoDB Aggregation</a></p><p>· <a href="https://medium.com/@vigowebs/frequently-asked-mongodb-interview-questions-and-answers-1f17c6b0950d">MongoDB Interview Questions and Answers</a></p><p>Great, you have reached the end. If you are a JavaScript developer, bookmark this because these topics will be very helpful in your next interview.</p><p>PS: Thank you <a href="https://www.linkedin.com/in/mikr13/">*Mihir</a> *&amp; <a href="https://www.linkedin.com/in/ravi-rajan-75b50a18b/">*Ravi</a> *for proofreading and adding more value to this article.</p><p>Please give me a clap if it is helpful!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*UqrzkInIso64f82OWdXSTg.gif" /><figcaption>DONE</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c6ea1101e4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[fastify typescript generator: a generator to bootstrap fastify server with typescript]]></title>
            <link>https://alok722.medium.com/fastify-typescript-generator-a-generator-to-bootstrap-fastify-server-with-typescript-6a39bcea7a4?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a39bcea7a4</guid>
            <category><![CDATA[fastify-generator]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[fastify]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Fri, 04 Sep 2020 17:56:59 GMT</pubDate>
            <atom:updated>2020-09-04T17:58:33.987Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*lMZW8GNb8TF0FHwmflClvg.jpeg" /><figcaption>fastify</figcaption></figure><p><strong>hey reader,</strong> 👋</p><p>🚀 lately me and my friend <a href="https://linkedin.com/in/Mikr13"><strong>Mihir </strong></a>were working together on <a href="https://www.npmjs.com/package/fastify-typescript-generator"><strong>fastify-typescript-generator</strong></a> which we released last week on node package manager.</p><p>🤔 <strong>what </strong>is <a href="https://www.fastify.io/">fastify </a>and <strong>why </strong><a href="https://www.fastify.io/">fastify</a>?<br>fastify is a webframework highly focused on speed and low overhead. it is inspired by expressjs and hapi, it is one of the fastest web frameworks in town. Using fastify can increase your throughput by up to 100%.</p><p>❓ <a href="https://www.npmjs.com/package/fastify-typescript-generator">fastify-typescript-generator</a>, ehh… <strong>what</strong>?<br>It creates a new fastify application as a starter boilerplate similar to the fastify-cli module. except this new application is configured to use typeScript instead of plain javascript and provides various options such as, kind of project structure to use with focus on plugin structure for fastify developers and express structure for express developers, it also provides options for typeorm or mongoose.</p><p><strong>v0.1.9</strong> is active with an interactive CLI and options to choose from while creating a template server, it has started gaining popularity with 600+ weekly download.</p><p>✨future planned features<br>* a command-based operation<br>* templates with #docker support (Dockerfile and docker-compose)<br>* a view engine support and much more.</p><p>👨‍💻 This is the first of many upcoming products from <a href="https://github.com/open-devs/"><strong>opendevs </strong></a>(an organization of two motivated developers (@<a href="https://www.linkedin.com/in/alok722/"><strong>alok722</strong></a>, @<a href="https://www.linkedin.com/in/Mikr13/"><strong>MiKr13</strong></a>) building open source enterprise-level software to contribute to the community.</p><blockquote>more details below,</blockquote><ul><li><a href="https://www.npmjs.com/package/fastify-typescript-generator">fastify-typescript-generator</a></li><li><a href="https://github.com/open-devs/fastify-typescript-generator">open-devs/fastify-typescript-generator</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a39bcea7a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Roadmap to become Web Developer in 2020]]></title>
            <link>https://alok722.medium.com/roadmap-to-become-web-developer-in-2020-bd7ed7ed8ad5?source=rss-e10e116247f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd7ed7ed8ad5</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-developer]]></category>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alok Raj]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 21:35:12 GMT</pubDate>
            <atom:updated>2021-04-18T08:25:33.610Z</atom:updated>
            <content:encoded><![CDATA[<h3>Roadmap to becoming Web Developer with free resources [updated][2021]</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lOrGXI8JXwWcEJK1" /><figcaption>Photo by <a href="https://unsplash.com/@jerrykavan?utm_source=medium&amp;utm_medium=referral">Jaromír Kavan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are a total beginner to web development and thinking to dive deep into web development then you are at the right place. I am damn sure at the end of this article you will be having a clear picture of <strong><em>Where </em></strong>to Start, <strong><em>What </em></strong>to study, and <strong><em>How </em></strong>to study.</p><blockquote><strong>⚠</strong> If you already have some exposure to web development then I will recommend you to visit <a href="https://roadmap.sh/">roadmap.sh</a>. It contains a detailed analysis of stacks to become a web developer. Also, you can read about my <a href="https://alok722.medium.com/story-of-transition-to-the-senior-se-role-2c6ea1101e4a"><strong><em>Story of Transition to the Senior SE role</em></strong></a></blockquote><p>Before diving into where and how let’s understand <strong>WHAT?</strong></p><p>What is Frontend? What is Backend? What is Full-stack? How these are co-related? Find answers to all your questions <a href="https://www.youtube.com/watch?v=pkdgVYehiTE">here</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpkdgVYehiTE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpkdgVYehiTE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FpkdgVYehiTE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd61a72b6e068deff7e30d6b4e118b91/href">https://medium.com/media/cd61a72b6e068deff7e30d6b4e118b91/href</a></iframe><p>Hope now, you understand <strong>What </strong>is web development. Let’s understand from where we can get started with these.</p><p>Concisely to become a full-stack <strong><em>Javascript</em></strong> developer, You need to accomplish these in the sequence. I will discuss these in detail as we go along in this article.</p><blockquote><strong>step 1: learn HTML<br>step 2: learn CSS<br>step 3: learn CSS Frameworks (</strong>e.g.: Bootstrap, Tailwind etc.<strong>)<br>step 4: learn JavaScript<br>step 5: learn nodejs / expressjs </strong>(or, Hapi, KoaJs, fastify, NestJs etc.)<strong><br>step 6: learn sql / nosql </strong>(mongodb, PostgreSQL etc.)<strong><br>step 7: learn react / vue / angular<br>step 8: go back to step 4</strong></blockquote><p>🏆 congratulations, you are now a full-stack developer.</p><p>Now, let me start to discuss one at a time, what and from where you need to learn to get started in these tech domains. Some may argue, why not React/Vue/Angular first and then Node/Express. My take on this: You are free to do so but since all these front-end frameworks/libraries are dependent on package manager so why not learn Node first.</p><h4>HTML -&gt; CSS -&gt; CSS FRAMEWORK (e.g.: Bootstrap, Tailwind)</h4><p><strong>HTML</strong>: Hypertext Markup Language is the standard mark-up language for documents designed to be displayed in a web browser.</p><p>Must know topics: What is HTML? Anatomy of HTML Tag, HTML Document Structure, <a href="https://html-css-js.com/html/tags/">Essential HTML Tags</a>, HTML form.</p><p><strong>CSS</strong>: Cascading Style Sheets is a style sheet language that explains the presentation of a document written in a mark-up language like HTML.</p><p>Must-know topics: What is CSS? Anatomy of CSS, CSS Selectors (Element, Class and ID), Combining selectors, Pseudo selectors, CSS Specificity (Conflict Resolution), Box Model and Layout, CSS Grid, CSS Flexbox, Relative vs Absolute element positioning, Box Model, Media Queries (Responsive design using CSS).</p><p><strong>CSS FRAMEWORK</strong>: It is a CSS framework to ease the design process. These are free and open-source CSS frameworks directed at responsive, mobile-first front-end web development. It contains CSS- and JavaScript-based design templates for typography, forms, buttons, navigation, and other interface components. Eg.: <a href="https://getbootstrap.com/">https://getbootstrap.com/</a>, <a href="https://tailwindcss.com/">https://tailwindcss.com/</a></p><h3>JAVASCRIPT</h3><p>It is often abbreviated as JS, is a programming language that conforms to the ECMAScript specification. It is high-level, often just in time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object orientation, and first-class functions.</p><p>In JavaScript, there is a lot to learn, so instead of mentioning topics, Now, I will recommend you the courses, which you can follow and get comfortable with. You can visit the <a href="https://javascript.info/"><strong>javascript.info</strong></a><strong> </strong>website for detailed and well documentation of JavaScript.</p><p>Courses you can follow for getting started with HTML, CSS &amp; JS.</p><p><a href="https://www.coursera.org/learn/html-css-javascript-for-web-developers"><strong>HTML, CSS, and JavaScript for Web Developers </strong></a><strong>:</strong></p><p>It is one of the brilliant courses available to get started with web development. Here, you will get to learn HTML, CSS, Bootstrap, JavaScript, and AJAX. You can apply for <strong>financial aid</strong> or you can simply audit the course.</p><p><strong>OR</strong></p><p><a href="https://www.udemy.com/course/the-web-developer-bootcamp/"><strong>The Web Developer Bootcamp</strong></a>:</p><p>Over here, I will suggest you complete until SECTION 20 (To DO Lists Project).</p><p>Once you are done with the above-stated course, then now is a good time to dive deep and know all about <strong>JavaScript &amp; </strong>its architecture<strong>.</strong></p><h4><a href="https://www.udemy.com/course/modern-javascript/"><strong>The Modern JavaScript Bootcamp</strong></a></h4><p>The perfect and complete course, which helps you to understand every nuke and corner of JS. This course is a perfect combo of project-based learning as well as a deeper dive into the why and how of JavaScript.</p><p><strong>OR</strong></p><p>you can refer to this video and playlist for getting started with JS. <strong>[<em>FREE</em>]</strong></p><p><a href="https://www.youtube.com/playlist?list=PL_c9BZzLwBRLVh9OdCBYFEql6esA6aRsi"><strong>All About JavaScript</strong></a></p><p><a href="https://www.youtube.com/watch?v=qoSksQ4s_hg&amp;list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET&amp;ab_channel=TheNetNinja"><strong>JavaScript Basics</strong></a></p><p><a href="https://www.youtube.com/watch?v=nZ1DMMsyVyI&amp;ab_channel=freeCodeCamp.org"><strong>JavaScript ES6, ES7, ES8</strong></a></p><p>also, there is one ongoing course from Akshay Saini which discussed architecture and behind the scene of JavaScript. [<a href="https://www.youtube.com/watch?v=pN6jk0uUrD8&amp;list=PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&amp;ab_channel=AkshaySaini"><strong>Namaste Javascript</strong></a>]</p><p><strong><em>Optional</em></strong><em>: (Now is the good time to revise whatever you have learned.) I will recommend you to visit</em><a href="https://www.freecodecamp.org/learn"><em> freecodecamp</em></a><em> and complete the projects of </em><strong><em>Responsive web design certification </em></strong><em>to get the certificate; if you feel stuck, you can definitely go through the tutorial provided there.</em></p><p>Once you are done with these above, now is a good time to dive into the framework/library.</p><h4><a href="https://nodejs.org/en/">NODE</a> -&gt;<a href="https://expressjs.com/"> EXPRESS</a> -&gt;<a href="https://www.mongodb.com/"> MONGO-DB</a></h4><p>For Backend, I will recommend a single course. Also, you can study each topic in detail by following a separate tutorial for each.</p><h4><a href="https://www.udemy.com/course/nodejs-express-mongodb-bootcamp/">Node.js, Express, MongoDB &amp; More: The Complete Bootcamp 2021</a></h4><p>This course is a top-rated course on Udemy. This course has beautifully covered all the essentials of the Backend covering NodeJS, Express JS, Mongo, and Mongoose along with Unit Testing.</p><p>you can refer to these videos and playlists for getting started with Node.JS <strong>[<em>FREE</em>]</strong></p><p><a href="https://www.youtube.com/playlist?list=PLillGF-RfqbYRpji8t4SxUkMxfowG4Kqp"><strong>Node.Js &amp; Express from Scratch</strong></a></p><h4>FRONTEND LIBRARY/FRAMEWORK (e.g.: React, Vue, Angular):</h4><p>I will provide the links of course which I found amusing. I, being a MEAN stack developer, have experienced Angular &amp; React courses myself and for Vue, I have taken opinions from my friends working with Vue.</p><p><em>Note: Which frontend framework/lib to choose?</em></p><p><em>Seeing the current market scenario, React is the first choice but at the same time, Vue JS is rising slowly and is expected to surpass React totally. Earlier Angular was at the top, not anymore. However, it does not matter which framework you know, once you are comfortable with any library or framework then you can easily pick others too. For more analysis on what to choose, you can search and find many helpful articles.</em> <em>The major difference between the different stacks can be found </em><a href="https://www.youtube.com/watch?v=KMX1mFEmM3E"><em>here</em></a><em>.</em> <em>And if you just want to know individually what they are, that you can see </em><a href="https://www.youtube.com/watch?v=5XlYQRGgYrY"><em>here</em></a><em>.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKMX1mFEmM3E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKMX1mFEmM3E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKMX1mFEmM3E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e2ccb06b93f302120c8d347cdb52b94/href">https://medium.com/media/5e2ccb06b93f302120c8d347cdb52b94/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5XlYQRGgYrY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5XlYQRGgYrY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5XlYQRGgYrY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e04bb0c873f4ecdd24d2a77ce18fe94/href">https://medium.com/media/2e04bb0c873f4ecdd24d2a77ce18fe94/href</a></iframe><h4><a href="https://angular.io/"><strong>ANGULAR</strong></a></h4><p><a href="https://www.udemy.com/course/the-complete-guide-to-angular-2/"><strong>Angular — The Complete Guide (2020 Edition)</strong></a><strong>:</strong></p><p>It is one of the most comprehensive courses on angular. It is actually a bit too many details sometimes but better be safe than sorry.</p><p>Or,</p><p>you can follow <a href="https://www.youtube.com/watch?v=0eWrpsCLMJQ&amp;list=PLC3y8-rFHvwhBRAgFinJR8KHIrCdTkZcZ&amp;ab_channel=Codevolution">this</a> to quickly get started with Angular. <strong>[<em>FREE</em>]</strong></p><p><a href="https://www.youtube.com/watch?v=0eWrpsCLMJQ&amp;list=PLC3y8-rFHvwhBRAgFinJR8KHIrCdTkZcZ&amp;ab_channel=Codevolution"><strong>Angular Tutorial for Beginners</strong></a></p><h4><a href="https://vuejs.org/"><strong>Vue JS</strong></a></h4><p><a href="https://www.udemy.com/course/vuejs-2-the-complete-guide/"><strong>The Complete Guide (incl. Vue Router &amp; Vuex)</strong></a><strong>:</strong></p><p>Being one of the highest-rated courses on Udemy taught by Maximilian Schwarzmüller, I can undoubtedly say, <strong>Go</strong> for it. He is one of the BEST instructors present in the tech industry.</p><p><strong>OR</strong></p><p>you can refer to these videos and playlists for getting started with VueJs. <strong>[<em>FREE</em>]</strong></p><p><a href="https://www.youtube.com/watch?v=5LYrN_cAJoA&amp;list=PL4cUxeGkcC9gQcYgjhBoeQH7wiAyZNrYa&amp;ab_channel=TheNetNinja"><strong>VueJs 2</strong></a><strong> + </strong><a href="https://www.youtube.com/watch?v=BGAu__J4xoc&amp;list=PL4cUxeGkcC9i371QO_Rtkl26MwtiJ30P2&amp;ab_channel=TheNetNinja"><strong>Vuex</strong></a></p><p>or,</p><p><a href="https://www.youtube.com/watch?v=e-E0UB-YDRk&amp;ab_channel=Bitfumes"><strong>VueJs 3</strong></a><strong> + </strong><a href="https://www.youtube.com/watch?v=BGAu__J4xoc&amp;list=PL4cUxeGkcC9i371QO_Rtkl26MwtiJ30P2&amp;ab_channel=TheNetNinja"><strong>Vuex</strong></a></p><h4><a href="https://reactjs.org/"><strong>React JS</strong></a></h4><p><a href="https://www.udemy.com/course/react-redux/"><strong>Modern React with Redux</strong></a></p><p><strong>OR</strong></p><p>you can refer to these videos and playlists for getting started with ReactJs. <strong>[<em>FREE</em>]</strong></p><p><a href="https://www.youtube.com/watch?v=QFaFIcGhPoM&amp;list=PLC3y8-rFHvwgg3vaYJgHGnModB54rxOk3&amp;ab_channel=Codevolution"><strong>React</strong></a><strong> + </strong><a href="https://www.youtube.com/watch?v=9boMnm5X9ak&amp;list=PLC3y8-rFHvwheJHvseC3I0HuYI2f46oAK&amp;ab_channel=Codevolution"><strong>Redux</strong></a></p><p>or,</p><p><a href="https://www.youtube.com/watch?v=OxIDLw0M-m0&amp;list=PL4cUxeGkcC9ij8CfkAY2RAGb-tmkNwQHG&amp;ab_channel=TheNetNinja"><strong>React with Redux</strong></a></p><p>Whatever front-end library/framework you choose and complete the course then start building projects on top of that.</p><p>IDE Suggestion:<a href="https://code.visualstudio.com/"> https://code.visualstudio.com/</a></p><p>If you wish to explore more and find some more relative tutorials. You can follow this <a href="https://hackr.io/">link</a>.</p><p><em>Congratulations</em>, now you are ready to dive and become a full-stack JavaScript developer.</p><p>Want to know about my journey. Read that here:</p><h4><a href="https://alok722.medium.com/story-of-transition-to-the-senior-se-role-2c6ea1101e4a">Story of Transition to the Senior SE role</a></h4><p>You can find me on <a href="https://www.linkedin.com/in/alok722/">LinkedIn</a> !!!</p><p>Feedback appreciated !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd7ed7ed8ad5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>