<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Isha Saxena</title>
    <description>The latest articles on DEV Community by Isha Saxena (@ishasaxenaa_).</description>
    <link>https://dev.to/ishasaxenaa_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1212462%2F0e6f8210-f16a-4da6-a61c-b57da6fef584.png</url>
      <title>DEV Community: Isha Saxena</title>
      <link>https://dev.to/ishasaxenaa_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ishasaxenaa_"/>
    <language>en</language>
    <item>
      <title>React Interview Questions Exp 2-3 yrs</title>
      <dc:creator>Isha Saxena</dc:creator>
      <pubDate>Thu, 14 Dec 2023 12:07:53 +0000</pubDate>
      <link>https://dev.to/ishasaxenaa_/react-interview-questions-exp-2-3-yrs-2gp7</link>
      <guid>https://dev.to/ishasaxenaa_/react-interview-questions-exp-2-3-yrs-2gp7</guid>
      <description>&lt;p&gt;Remove duplicate elements from an array &lt;br&gt;
arr=[1,2,1,1,3,4,5,5]&lt;br&gt;
arr.reduce(function(accumulator,currentValue){&lt;br&gt;
if(accumulator.indexOf(currentValue)===-1){&lt;br&gt;
accumulator.push(currentValue)&lt;br&gt;
}&lt;br&gt;
return accumulator&lt;br&gt;
},[])&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the main features/advantages of using React?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Uses Virtual DOM whenever a React application gets changes in state/prop it will re-render itself during re-render React uses Virtual DOM, Virtual DOM is an in memory representation of Real DOM whenever the application re-renders React will create a new Virtual DOM and will compare it with already existing Virtual DOM uses diffing algorithm and will update only those nodes which have changed only .&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React uses JSX which is JavaScript XML it is a syntactic sugar which makes us be able to develop a component and write its HTML and JavaScript together&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.React has unidirectional data flow where data can only flow from Parent to child or top to bottom .&lt;/p&gt;

&lt;p&gt;4.React follows a component based architechture where single reusable pieces of codes are classified into components and are further assembled together to develop User interface&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are problems like prop drilling in react?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So basically as we know in React the data flows from top to bottom like from parent to child then suppose we have a 5 level of component based application data flows from A-&amp;gt;B-&amp;gt;C-&amp;gt;D-&amp;gt;E&lt;br&gt;
now you want to transfer data from A to E this will make your code less maintainable and suppose B,C,D do not want to use your data then its code duplication also so to avoid this we use global state management features in React like &lt;br&gt;
Context API and Redux&lt;/p&gt;

&lt;p&gt;4.What are useMemo() and useCallBack() hooks in react used for?&lt;/p&gt;

&lt;p&gt;So sometimes when we are doing some expensive calculation during re-rendering of our application this expensive calculation will happen again and again on any state/prop change even if suppose this is sum of thousand numbers so even if only THEME of application is changed and it has no relation to sum of 1000 nos still this calculation will be done again &lt;/p&gt;

&lt;p&gt;THAT IS WHERE THE PROBLEM IS!!!!&lt;br&gt;
Doing expensive calculation again and again when not needed !!&lt;br&gt;
So making the performance of application SLOWWWWWWWW!!!&lt;br&gt;
SOLUTION &lt;/p&gt;

&lt;p&gt;useMemo() hook will cache or memoize the result of these expensive calculation it accepts a value to be remembered and a dependency &lt;br&gt;
useMemo(Value to be memoized,dependecy)&lt;br&gt;
useMemo(sumofThousandNumbersResult,inputNum)&lt;/p&gt;

&lt;p&gt;Sameway works useCallBack() except that it will cache whole function and will only re-run this functn when actually needed&lt;/p&gt;

&lt;p&gt;useCallback(callback function,dep)&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why 0.1 +0.2 is not equal to 0.3 is javaScript ???</title>
      <dc:creator>Isha Saxena</dc:creator>
      <pubDate>Fri, 17 Nov 2023 18:39:03 +0000</pubDate>
      <link>https://dev.to/ishasaxenaa_/why-01-02-is-not-equal-to-03-is-javascript--3h7k</link>
      <guid>https://dev.to/ishasaxenaa_/why-01-02-is-not-equal-to-03-is-javascript--3h7k</guid>
      <description>&lt;p&gt;Its because 0.1+0.2 will not give you 0.3 expected &lt;br&gt;
Because numbers in JS are stored in binary format and it uses&lt;br&gt;
IEEE-754 format to store the number&lt;/p&gt;

&lt;p&gt;Here the CATCH ISSSS  if the number size is longer than 64 bit then the least significant figures are rounded up&lt;/p&gt;

&lt;p&gt;The solution is to use toPrecision() this method allows to cut or round up the remaining disturbing noise in this calculation for eg &lt;/p&gt;

&lt;p&gt;if say let sum=0.1 +0.2 &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kencEOgN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9cm1cxpgbi373jza9nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kencEOgN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o9cm1cxpgbi373jza9nj.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
let result=parseFloat(sum.toPrecision(12))&lt;br&gt;
now console.log(result===0.3)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;javascriptinterviewquestions&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
  </channel>
</rss>
