<?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 Azeem Aleem on Medium]]></title>
        <description><![CDATA[Stories by Azeem Aleem on Medium]]></description>
        <link>https://medium.com/@azeemaleem?source=rss-1acf379b9695------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JlYxdTKQ_uipdLG3D-G1og.png</url>
            <title>Stories by Azeem Aleem on Medium</title>
            <link>https://medium.com/@azeemaleem?source=rss-1acf379b9695------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:52:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@azeemaleem/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[Stop Using Inline Styles in React]]></title>
            <link>https://azeemaleem.medium.com/stop-using-inline-styles-in-react-85a21ad268c9?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/85a21ad268c9</guid>
            <category><![CDATA[react-inline-styling]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[avoid-inline-styles]]></category>
            <category><![CDATA[inline-style]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Mon, 15 May 2023 11:20:05 GMT</pubDate>
            <atom:updated>2023-05-15T11:30:21.854Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nj3N69vrhUgg3aH9CUVJjw.jpeg" /></figure><p>Always avoid passing inline Styles to any react components. It&#39;s a little tiny thing that causes a huge problem in our React app. To really understand this problem we will review the basic react fundamentals.</p><p><strong>Whenever a prop or state changes, react component re-render.</strong></p><pre>function App(){<br>  <br>  return{<br>    &lt;&gt;<br>      &lt;MyComponent style={{height:&quot;10px&quot;}}/&gt;<br>    &lt;/&gt;<br>  }<br>}</pre><p>If I pass an inline CSS Object in our Component like this. Please notice it&#39;s an object <strong>{height:”10px”}.</strong></p><p>In the fundamentals of Javascript, Objects are not equal to the same object. Let me prove it. If I compare two same objects in the console, it&#39;s returning false.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*yqi7QrpqhaH6EhkL0XDwYg.png" /></figure><p>Two same objects are not the same because it&#39;s located on different memory addresses.</p><p>Using an object literal directly as a style prop in React, such as &lt;MyComponent style={{height:&quot;10px&quot;}}/&gt;, can lead to unnecessary re-renders.</p><p><strong>This happens because the object reference changes on each render, causing React&#39;s diffing algorithm to consider the style prop as a different value, even if the actual style properties remain the same.</strong></p><p>So using Inline CSS in react components cause a little micro re-rendering everywhere in the react application. Because you didn&#39;t handle the styles correctly.</p><p>So, how we can fix that issue?</p><h3>Solutions</h3><p>To avoid this issue, you can use a more stable approach by defining the style object outside of the component render function.</p><pre>const styles = {<br>  height: &quot;10px&quot;<br>};<br><br>function App() {<br><br>  return &lt;MyComponent style={styles}&gt; /&gt;;<br>}</pre><p>By defining the styles object outside the component, it remains the same between renders, ensuring that the style prop won&#39;t trigger unnecessary re-renders.</p><p>Alternatively, if you need to dynamically change the style based on component state or props, you can use the useMemo hook to memoize the style object. This ensures that the object reference only changes when the dependencies have changed.</p><pre>import { useMemo } from &#39;react&#39;;<br><br>function App({ height }) {<br><br>  const styles = useMemo(() =&gt; ({<br>    height: `${height}px`<br>  }), [height]);<br><br>  return &lt;MyComponent style={styles} /&gt;;<br>}</pre><p>In this example, the styles object is memoized using the useMemo hook with the height prop as a dependency. The object will only be recalculated if the height prop changes, preventing unnecessary re-renders.</p><p>By using either of these approaches, you can optimize the rendering behavior and ensure that the component doesn’t re-render unnecessarily due to style prop changes.</p><p>Follow for more</p><p>LinkedIn: <a href="https://www.linkedin.com/in/azeemaleem/">https://www.linkedin.com/in/azeemaleem/</a></p><p>Twitter: <a href="https://twitter.com/AzeemAleem12">https://twitter.com/AzeemAleem12</a></p><p>Medium: <a href="https://medium.com/@azeemaleem">https://medium.com/@azeemaleem</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85a21ad268c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to convert 12 hours into 24 hours in javascript | Problem-solving]]></title>
            <link>https://azeemaleem.medium.com/how-to-convert-12-hours-into-24-hours-in-javascript-problem-solving-1af0d445b0a7?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/1af0d445b0a7</guid>
            <category><![CDATA[time-convertion-function]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[convert-12h-into-24h]]></category>
            <category><![CDATA[javascript-time-convert]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 05:22:17 GMT</pubDate>
            <atom:updated>2022-10-25T05:22:17.756Z</atom:updated>
            <content:encoded><![CDATA[<p>Convert 12 hours time into 24 hours using Custom Javascript function</p><pre>function convert12to24(time12h) {</pre><pre>const [time, modifier] = time12h.split(&quot; &quot;);</pre><pre>let [hours, minutes] = time.split(&quot;:&quot;);</pre><pre>if (hours === &quot;12&quot;) {</pre><pre>hours = &quot;00&quot;;</pre><pre>}</pre><pre>if (modifier === &quot;PM&quot;) hours = Number(hours) + 12;</pre><pre>console.log(`${hours}:${minutes}`);</pre><pre>return `${hours}:${minutes}`;</pre><pre>}</pre><pre>convert12to24(&quot;03:00 PM&quot;);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1af0d445b0a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping React Life Cycles into UseEffect()]]></title>
            <link>https://azeemaleem.medium.com/mapping-react-life-cycles-into-useeffect-f7207f1e2857?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7207f1e2857</guid>
            <category><![CDATA[useeffect]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[lifecycles-into-useeffect]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[lifecycle-hook]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 13:23:25 GMT</pubDate>
            <atom:updated>2021-11-17T05:48:12.773Z</atom:updated>
            <content:encoded><![CDATA[<h3>React Mapping React Life Cycles into UseEffect()</h3><p>How to convert Life Cycles methods into useEffect hook? <br>In this article, I’ll show you how to map react life cycles to useEffect hook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8zRH7weWDDjM6lDxO4mjbg.jpeg" /></figure><p>React Class components Life cycles List</p><pre>1) componentDidMount() {}<br>2) componentDidUpdate(prevProps, prevState, snapshot) {}<br>3) shouldComponentUpdate(nextProps, nextState) {}<br>4) componentWillUnmount() {}</pre><p><strong>1- ComponentDidMount<br></strong>Pass an empty dependency Array</p><pre>useEffect(() =&gt; {<br>  // code run when the component is mounted <br><br>  // Make sure this is empty to ensure hook will only run once<br>}, [])</pre><p><strong>2- shouldComponentUpdate<br></strong>Add any value to the dependency array of useEffect</p><pre>/ props: {name}<br>// state: {visible}<br><br>useEffect(() =&gt; {<br>  // ... code to run<br>}, [name, visible])</pre><p><strong>3- componentWillUnmount</strong><br>we can use this useEffect with and without Dependency Array</p><pre>useEffect(() =&gt; {<br>  return () =&gt; {<br>    // code to run when the component is unmounted<br>  }<br>})</pre><p><strong>4- </strong>componentDidUpdate</p><pre>const hasMount = useRef(false)<br><br>useEffect(() =&gt; {<br>  if (hasMount.current) {<br>    // code to run when the component is updated<br>  } else {<br>    hasMount.current = true<br>  }<br>}, /* dependencies */)`</pre><p><strong>Important Points</strong></p><ul><li>You can only define one of each lifecycle method in a class component. When using hooks you can define as many useEffect as you want.</li><li>You can only use useEffect in a function component</li></ul><p><strong>Follow me on LinkedIn to catch more interesting Javascript and React Js concepts <br>Link: </strong><a href="https://www.linkedin.com/in/azeem-aleem-560345148/">https://www.linkedin.com/in/azeem-aleem-560345148/</a></p><p>Thanks for reading this article<br>Regards</p><p>Azeem Aleem</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7207f1e2857" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Callback in the useState() Hook?]]></title>
            <link>https://javascript.plainenglish.io/how-to-use-callback-in-usestate-hook-afe4113d9ac0?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe4113d9ac0</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 09:59:57 GMT</pubDate>
            <atom:updated>2021-08-24T12:04:15.853Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Use Callback function in React’s useState()</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rP0BffxgBneSokj2amV5kw.jpeg" /></figure><p>If you are working with class components in React so maybe you are familiar with the callback function in setState().</p><pre>setState(updateState, callbackFunction)</pre><pre>this.setState({name: “Azeem Aleem”},()=&gt;{<br>console.log(“State Response”,this.state.name);<br>})</pre><p>This callback function always calls after state update. But in functional components, the scenario is a little bit different.</p><p><strong>We cannot use callback directly in the useState hook. To use callback in the useState hook, we need to use the useEffect hook that triggers after state update and call the function after that.</strong></p><pre>const [state, setState] = useState();<br>useEffect(() =&gt; {callbackFunction()}, [state])</pre><p>We need to pass state in the useEffect Dependency Array. useEffect is triggered when the state updates and then calls the inside function immediately.</p><p><strong>Follow me on </strong><a href="https://www.linkedin.com/in/azeem-aleem-560345148/"><strong>LinkedIn</strong></a></p><p><em>Any questions? Please comment<br>Thanks<br>Regards: Azeem Aleem</em></p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afe4113d9ac0" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/how-to-use-callback-in-usestate-hook-afe4113d9ac0">How to Use Callback in the useState() Hook?</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 30 JavaScript and React Interview Questions & Answers for 2021]]></title>
            <link>https://javascript.plainenglish.io/top-30-react-interview-questions-answers-for-2021-6ec4274055f2?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ec4274055f2</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Fri, 20 Aug 2021 06:06:07 GMT</pubDate>
            <atom:updated>2021-08-24T12:09:25.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Some of the most-asked JavaScript and React interview questions which I extracted from different interviews. I am going to display all React and JavaScript questions and answers on my official LinkedIn Account.</p><p>The most interesting thing is that you can get the answers from different angles and I hope that would be more beneficial for you to become a professional React or JavaScript developer.</p><p>Most experienced and professional people are connected in my circle. They put up their answers against each post. Please check and view all the answers in the comment section.</p><h4>JavaScript and <strong>React Interview Questions and Answers</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhgxnRF4a33v29BnOdP5AA.png" /></figure><p>The answer to Question 1: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-javascript-webdevelopment-activity-6800433080386494464-Gmsj">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0sKSdAsweusH5kb6EVKGw.png" /></figure><p>The answer to Question 2: Click <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-webdevelopment-arrays-activity-6800653916708069376-LctA">Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0-_tPwwAT7LOvyaBvpnuQ.png" /></figure><p>The answer to Question 3: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-webdevelopment-interviewquestion-activity-6801012324221247488-VBbU">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4i7TqrCUQ8aTokmH_Bw_A.png" /></figure><p>The answer to Question 4: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-webdevelopment-interviewquestion-activity-6801373065000321024-Pemw">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSnMYkqKeF3A3evtfJlJpg.png" /></figure><p>The answer to Question 5:<a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-javascript-ecommercewebsite-activity-6802462618964516864-pbqo"> Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSX_8gZdRgr-SmbPg3zzvA.png" /></figure><p>The answer to Question 6: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-javascript-jsdeveloper-activity-6802824458726985729-gf96">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLH4pdvTprXxDdSO51FZMg.png" /></figure><p>The answer to Question 7: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-interview-javacode-activity-6803188217370697728-jwjR">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEqZbL-gdFzWoSNQ-sU_cA.png" /></figure><p>The answer to Question 8: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interview-javascript-reactjsdevelopment-activity-6803554321213464576-fRn4">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8J4yp-72p2CXz3Lm5ZFOA.png" /></figure><p>The answer to Question 9: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interview-interviewtips-javascript-activity-6803908749137330176-6ROf">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGDXpO96B0ltiXwA69J9hQ.png" /></figure><p>The answer to Question 10: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interview-education-javascript-activity-6804984921447268353-kMuw">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnSKAi61ZzhCXBupVmF0Bg.png" /></figure><p>The answer to Question 11: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-interview-reactjsdevelopment-activity-6805367321020923904-iFax">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nH1CzaOrWHMGuk6OzQlkdw.png" /></figure><p>The answer to Question 12: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-interview-programming-activity-6805710197823152128-7SBF">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6Qww-267m3kjBvGxfaRJw.jpeg" /></figure><p>The answer to Question 13: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-prototype-reactjs-activity-6806088907894198273-e2zT">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzSaez3FwgssCmA2k2ZTPA.png" /></figure><p>The answer to Question 14: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-reactjs-reactjsdevelopment-activity-6806558076943011840-ctGz">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROatd3pKOGBhpqYrYXCg0w.png" /></figure><p>The answer to Question 15: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interview-reduxjs-redux-activity-6808303186479222784-CJBX">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWRWIASoJHQKQ_vv02hifA.png" /></figure><p>The answer to Question 16: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-reactjs-webdevelopment-activity-6808682048732053504-2NeK">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVhyXrfqbeNzNBEKfHFWlQ.png" /></figure><p>The answer to Question 17: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-webservices-developerlife-activity-6809003145541242880-HaxB">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k2D-eWY5qWt68TuhVgisiA.png" /></figure><p>The answer to Question 18: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_customhook-reactjs-interview-activity-6810860404667883520-eFJn">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lUHLmvN67xAKC6VHuQ6sQ.png" /></figure><p>The answer to Question 19: Yes we can use Built-in React Hooks like (useState,useEffect) inside Custom Hook of React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-io86O--J2vlraq9OhrP2g.png" /></figure><p>The answer to Question 20: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interviewpreparation-interviewquestions-javascript-activity-6812605955390369792-KRoN">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtyngjtKFnF6UW0B_oGP2g.png" /></figure><p>The answer to Question 22: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-reactjsdevelopment-reactjsdeveloper-activity-6813339916940914688-MJ5_">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFbJMjqow7DQEblnudBBeg.png" /></figure><p>The answer to Question 23: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-webbased-interview-activity-6813719709515571200-BTm0">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jqs74BtTz6XLUwve7tMQhQ.png" /></figure><p>The answer to Question 24: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_react-programming-interview-activity-6815274102320844800-Iudb">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LvDtmRdcVAl9xIiiXKFXMw.png" /></figure><p>The answer to Question 25: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-interview-react-activity-6816221471803748352-hv17">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBXcAQLgyfR9FIe1_7p6QQ.png" /></figure><p>The answer to Question 26: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_interviewquestions-interview-reactjs-activity-6816622578921168896-UZsY">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mV_9LQNsEYVOx5yHYt1nqQ.png" /></figure><p>The answer to Question 27: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-interview-webpack-activity-6818066424074903552-9Lf2">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFKXwe_uP8IMh98KqNrjJg.png" /></figure><p>The answer to Question 28: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_reactjs-reactdeveloper-reactnative-activity-6818420510083309568-rnjl">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*17NGgIA8Qi7jpd6kXoMxTQ.png" /></figure><p>The answer to Question 29: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-reactjs-webdevelopment-activity-6819150594461196288-hSJ3">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSW81q8VaUlIWuHH_s05iA.png" /></figure><p>The answer to Question 31: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-reactjs-webdevelopment-activity-6820603697240788993-IouO">Click Here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7kMXrGgcObkcDGRiyuRvg.jpeg" /></figure><p>The answer to the above Question: <a href="https://www.linkedin.com/posts/azeem-aleem-560345148_javascript-webdevelopment-interview-activity-6807276263628124161-j6L9">Click Here</a></p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ec4274055f2" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/top-30-react-interview-questions-answers-for-2021-6ec4274055f2">Top 30 JavaScript and React Interview Questions &amp; Answers for 2021</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web API vs Rest API]]></title>
            <link>https://azeemaleem.medium.com/web-api-vs-rest-api-8d50759214a3?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d50759214a3</guid>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[web-api-vs-rest-api]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webapi]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Sat, 05 Jun 2021 18:25:11 GMT</pubDate>
            <atom:updated>2021-06-05T18:25:11.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*G4wPoexpYWuh8ew3QtaYiQ.jpeg" /></figure><p><strong>What is the difference between API and REST API?</strong></p><p>Not all APIs are REST, but all REST services are APIs</p><p>So let’s start a common difference between API and REST API.</p><ul><li>API Stands for (Application Program Interface) and REST stands for (Representational State Transfer)</li><li>The Function of API is to connect one application to another application. You can say that it is a connector between two applications. On the other hand, REST API builds the connection between Client and server using URL and HTTP protocols.</li><li>REST APIs are widely used for exchanging data between systems or applications. API provides products or services to communicate with other products and services without having to know how they’re implemented.</li><li>API is a set of functions and procedures that allow one application to access the feature of other application.</li><li>API supports CRUD (Create Read Update Delete) actions as it works with HTTP verbs GET, PUT, POST, and DELETE.</li><li>REST API is a web service that supports only HTTP protocol whereas API supports HTTP/HTTPS protocol.</li><li>Web service supports XML while API supports XML and JSON</li></ul><p><strong>REST APIs</strong> Provide the ability to support remote procedure calls and they are loosely coupled as well. The main reason for excessive use of REST API’s because it requires limited resources, fewer security requirements, and browser compatibility and scalability as well.</p><p>Thanks for visit<br>Please follow me LinkedIn<br><a href="https://www.linkedin.com/in/azeem-aleem-560345148/">https://www.linkedin.com/in/azeem-aleem-560345148/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d50759214a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pure and Impure Functions in JavaScript]]></title>
            <link>https://azeemaleem.medium.com/pure-and-impure-functions-in-javascript-a4e844435806?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4e844435806</guid>
            <category><![CDATA[pure-function]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[impure-function]]></category>
            <category><![CDATA[javascript-programming]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Thu, 03 Jun 2021 14:36:00 GMT</pubDate>
            <atom:updated>2021-06-03T14:36:00.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqQZF5Vi7SdOscGFbigyjQ.jpeg" /></figure><h3>Pure Functions</h3><p>A Pure function is a function that does not modify any external variable. And the Impure function modifies the external variable.</p><p>A basic principle of functional programming is that it avoids changing the application state and variables outside its scope. Let see how it works in React.</p><p>var s=10;</p><p>exampleOfPureFunc=(a,b)=&gt;{</p><p>return a+b;</p><p>}</p><p>exampleOfPureFunc(10,5);</p><p>A pure function just takes some input and returns the output accordingly but it never changes any state of the component, it does not affect any external variables as well, like the value of s=10; so a pure function doesn’t any effect on this global variable.</p><ol><li>You can say that pure functions have no side effects.</li><li>Pure functions must not rely on variables outside their scope</li><li>Examples of pure functions are strlen(), pow(), sqrt(), array.length etc</li></ol><h3>Impure Functions</h3><p>Impure Functions have side effects it does make changes on external variables like this.</p><p>exampleOfImpureFunc = (a, b) =&gt; {</p><p>s = s + a + b;</p><p>return s;</p><p>}</p><p>exampleOfImpureFunc(10, 5);</p><p>// one more example here</p><p>// I am just creating a fake Object</p><p>const user = {</p><p>username: “Azeemaleem”,</p><p>password: “pakistan”</p><p>}</p><p>let isValidate = false</p><p>const validator = (user) =&gt; {</p><p>if (user.username.length &gt; 5 &amp;&amp; user.password.length &gt; 5) {</p><p>isValidate = true;</p><p>}</p><p>}</p><p>validator(user);</p><p>console.log(isValidate); //The value will be true.</p><p>You can see that it is causing a side effect(changes) on the external variable. Examples of impure functions are printf(), rand(), time(), etc.</p><p>Thanks for visit<br>Please follow me on LinkedIn</p><p><a href="https://www.linkedin.com/in/azeem-aleem-560345148/">https://www.linkedin.com/in/azeem-aleem-560345148/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4e844435806" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Async await in JavaScript & React Js]]></title>
            <link>https://azeemaleem.medium.com/async-await-in-javascript-react-js-937437c556e0?source=rss-1acf379b9695------2</link>
            <guid isPermaLink="false">https://medium.com/p/937437c556e0</guid>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[asyncawait]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Azeem Aleem]]></dc:creator>
            <pubDate>Wed, 02 Jun 2021 12:48:43 GMT</pubDate>
            <atom:updated>2021-06-02T12:48:43.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*lBgiGEyJpoI0Byye8m7_qQ.jpeg" /></figure><h3>What is Async/await in React</h3><p>Await” only works inside the Async functions. As you know that asynchronous function tasks are never dependent on each other. They never wait to complete the first execution and run parallel. so we are talking about “Await” today in this article.</p><p>Async/await is a new way to write Asynchronous code in JS. Before Async/Await we used callbacks and promises in our code. If you never know about promises, so you need to get the concept about promises from here.</p><p>Actually, when we need to load more data from different API endpoints, we mostly fetch the data using fetch() function. As you know that fetch() is an Async function so when we call a lot of fetch() functions to get the data from different API endpoints then he never waits to complete the first fetch(). In this case, your data might be lost if you are passing data to another component state. To solve this problem we use Async/await in our code.</p><p>When we call fetch() function with the await keyword, it means that await keyword telling the async function to stop the execution until the data comes/fetched from the server.</p><p>Async functions always return a “promise” and promise makes 3 possibilities (fulfilled, pending, rejected). So basically when we fetch some data from server using API, then here we use “await” to pause the function and start the function again after data comes from Server.</p><p>async asyncFunc=()=&gt; {</p><p>const data = await fetch(“/moviesList”);</p><p>return data;</p><p>}</p><p>Using “Await” we can conveniently handle multiple promises instead of using more .then() functions. For Error Handling, we use try, catch blocks. Here we just need to wrap the code in try block, if any error occurs during fetching of data from the server, we handle this error on catch block.</p><p>Even if we have multiple await lines, our catch block picks all the errors that occur in the code.</p><p>async asyncFunc=()=&gt; {</p><p>try {</p><p>const response = await fetch(“/moviesList”);</p><p>const data = await response.json();</p><p>return data;</p><p>}</p><p>catch (error) {</p><p>alert(error); // catches both errors</p><p>}</p><p>}</p><p>Thanks for visit:<br>Please follow me on LinkedIn: <a href="https://www.linkedin.com/in/azeem-aleem-560345148/">https://www.linkedin.com/in/azeem-aleem-560345148/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=937437c556e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>