<?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 Nikhil Jauhari on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Jauhari on Medium]]></description>
        <link>https://medium.com/@nikhiljauhari?source=rss-7832539bd7d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1XXTav1nnrtUgydb.</url>
            <title>Stories by Nikhil Jauhari on Medium</title>
            <link>https://medium.com/@nikhiljauhari?source=rss-7832539bd7d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 23:02:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhiljauhari/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[Let’s understand these two useful keywords, as a developer, you may have seen these keywords quite…]]></title>
            <link>https://medium.com/@nikhiljauhari/lets-understand-these-two-useful-keywords-as-a-developer-you-may-have-seen-these-keywords-quite-6bef7c091c5?source=rss-7832539bd7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bef7c091c5</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[async]]></category>
            <category><![CDATA[await]]></category>
            <dc:creator><![CDATA[Nikhil Jauhari]]></dc:creator>
            <pubDate>Mon, 04 Feb 2019 07:28:12 GMT</pubDate>
            <atom:updated>2019-02-04T09:29:03.170Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://vox.publicis.sapient.com/groups/xt-global/blog/2019/02/03/quick-intro-to-async-await-in-javascript">Quick intro. to Async &amp; Await in JavaScript.</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*HcvYU0W-OgsTcdjk.png" /><figcaption><em>source: Spoonflower</em></figcaption></figure><p>Let’s understand these two useful keywords, as a developer, you may have seen these keywords quite times. The fact is, if you have not encountered any need for using these keywords, after reading this post, you would probably rethink for utilizing these handy keywords, of course, if the use case match. Let’s start.</p><p>So if we write async before the function name (which is its syntax) then it assures that, now the function will always return a promise, even if you are writing a simple method which returns a simple value. The straight example to understand the case would be, if you are fetching some data from a remote .json file and showing that data into UI, but you may not be sure about the issues may occur, like the file path change, file doesn’t exist kinds etc, in such case you can wrap this function into async await, with this way you make sure that until the request is resolved and data has arrived neither the UI will render it nor breaks it. So await make sure that JavaScript waits until that promise settles and returns the result.</p><p>Example:</p><blockquote>async function asyncAwaitFun(value){</blockquote><blockquote>console.log(value);</blockquote><blockquote>let result = new Promise((res, rej) =&gt; {</blockquote><blockquote>setTimeout(() =&gt; res(value+5), 3000)</blockquote><blockquote>});</blockquote><blockquote>console.log(“After”);</blockquote><blockquote>let afterPromiseValue = await result;</blockquote><blockquote>console.log(“value after await”+ afterPromiseValue);</blockquote><blockquote>console.log(“Will print only after completing the request”);</blockquote><blockquote>}</blockquote><p>In the above example, the last console will print only after the request is completed, so we are holding it until we get the response from the previous execution.</p><p>Let’s check the below example, this example represents a practical scenario: fetchUserName(), prompts user to enter his Github username, inside this async function, we are fetching with await, because we want to alert the user name only when the API successfully fetched the data, else the user will see issues on page.</p><blockquote>async function fetchUserName() {</blockquote><blockquote>let user = prompt(“Enter your github username”, “”);</blockquote><blockquote>// read github user api via passed username</blockquote><blockquote>try {</blockquote><blockquote>let githubResponse = await fetch(`https://api.github.com/users/${user}`);</blockquote><blockquote>} catch (error) {</blockquote><blockquote>alert(error);</blockquote><blockquote>}</blockquote><blockquote>let githubUserData = await githubResponse.json();</blockquote><blockquote>let name = githubUserData.name;</blockquote><blockquote>alert(name);</blockquote><blockquote>return githubUserData;</blockquote><blockquote>}</blockquote><blockquote>fetchUserName();</blockquote><p>Isn’t the above example demonstrates a very common useful use case?</p><p>async/await works well with Promise.all, if we need to wait for multiple promises, we can wrap them in Promise.all and then await.</p><blockquote>let responseData = await Promise.all([</blockquote><blockquote>fetch(url-1),</blockquote><blockquote>fetch(url-2),</blockquote><blockquote>…</blockquote><blockquote>]);</blockquote><p>async: Make the function always return a promise.</p><p>await: make JavaScript wait until the promise is either resolve or reject so if,</p><p>If it’s an error, the exception is generated, same as if throw error were called at that very place.</p><p>Otherwise, it returns the result, so we can assign it to a value.</p><p>If you have thoughts &amp; suggestions, please comment down.</p><p>Discussion improves the situation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bef7c091c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why/How IT Companies have grown and growing day by day. | 5 min read.]]></title>
            <link>https://medium.com/@nikhiljauhari/why-how-it-companies-have-grown-and-growing-day-by-day-5dd28aa32988?source=rss-7832539bd7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5dd28aa32988</guid>
            <category><![CDATA[it-companies]]></category>
            <category><![CDATA[daybyday]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[growing]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Nikhil Jauhari]]></dc:creator>
            <pubDate>Sat, 11 Mar 2017 07:12:10 GMT</pubDate>
            <atom:updated>2017-03-11T07:17:45.318Z</atom:updated>
            <content:encoded><![CDATA[<p>First of all, here i am not proving anything, this is just my perspective, if you have your views (negative/positive) please share, nothing to hype ;).<br>Have you ever wondered why IT companies are growing/grown day by day, amazingly !!</p><p>Lets notice something from your life, if you are an IT employee, you spend most of time with your computer. Talking positively : in learning new technologies, new tricks, new features, new versions, giving more effort in improving your own previous tech skills, new things are coming day by day and you are getting into them &amp; it goes one…?</p><p>Anybody (Specially your boss) asks you to do so ? (may be some but not all) but you are doing it for your own sake of various kinds profits.</p><p>And what you are doing indirectly ? You are improving the company’s projects, you are becoming a great asset to the company, you are applying new tricks, techniques, technologies to the projects and making them awesome day by day. And your seamless efforts are growing steps for the company. Isn’t it?</p><p>A less talk but quite deep.</p><p>#HappyHoli ;)</p><p>Thanks !!</p><p>Nikhil Kumar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5dd28aa32988" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>