<?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: Aditya Vivek Thota</title>
    <description>The latest articles on DEV Community by Aditya Vivek Thota (@xq_is_here).</description>
    <link>https://dev.to/xq_is_here</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%2F257337%2Fba8f86c1-801d-4843-9404-a2b99090ebf3.png</url>
      <title>DEV Community: Aditya Vivek Thota</title>
      <link>https://dev.to/xq_is_here</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xq_is_here"/>
    <language>en</language>
    <item>
      <title>How does your web browser run Javascript?</title>
      <dc:creator>Aditya Vivek Thota</dc:creator>
      <pubDate>Mon, 26 Sep 2022 15:36:00 +0000</pubDate>
      <link>https://dev.to/xq_is_here/how-does-your-web-browser-run-javascript-273h</link>
      <guid>https://dev.to/xq_is_here/how-does-your-web-browser-run-javascript-273h</guid>
      <description>&lt;h4&gt;
  
  
  A quick summary
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_O6DZsr9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AQRavJb0VJP0Ox7pH" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_O6DZsr9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AQRavJb0VJP0Ox7pH" alt="" width="880" height="587"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Claudio Schwarz on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Questions on web browsers are frequently asked in interviews. For example, the process of loading a webpage in a browser from the moment a URL is entered is one of the most asked interview questions.&lt;/p&gt;

&lt;p&gt;Here, let’s talk specifically about how JavaScript (JS) runs.&lt;/p&gt;

&lt;p&gt;JS is a client-side scripting language. This means your browser (aka the client) runs it. How?&lt;/p&gt;

&lt;p&gt;Every browser comes with a JS Engine which also acts like a virtual machine that helps us run the code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Did you know that different browsers use different JS engines?
&lt;/h4&gt;

&lt;p&gt;👉🏻 Chrome uses V8&lt;br&gt;&lt;br&gt;
👉🏻 Edge uses Chakra&lt;br&gt;&lt;br&gt;
👉🏻 Firefox uses Spider monkey&lt;/p&gt;

&lt;p&gt;Here’s a simplified summary of what happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The JS engine locates the script/JS code, checks the syntax, and parses it into an Abstract Syntax Tree (AST). Think of it as a tree-like representation of the code. This step is done by a “ &lt;strong&gt;parser&lt;/strong&gt; ”.&lt;/li&gt;
&lt;li&gt;The AST is converted into bytecode and run by an interpreter. In the case of the V8 engine, the interpreter is called “ &lt;strong&gt;ignition&lt;/strong&gt; ”.&lt;/li&gt;
&lt;li&gt;The bytecode and the profiling data generated while running it is passed to a Just in time (JIT = compilation during runtime) compiler that can produce highly optimized machine code.&lt;/li&gt;
&lt;li&gt;In the case of the V8 engine, the compiler is called “ &lt;strong&gt;Turbofan&lt;/strong&gt; ”.&lt;/li&gt;
&lt;li&gt;In the case of Chakra and Spider monkey, there are some differences in these steps and they use two optimizing compilers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rest of the steps and architecture in most JS engines are similar.&lt;/p&gt;

&lt;p&gt;I hope you got a good overview.&lt;/p&gt;

&lt;p&gt;Here are some links for more in-depth exploration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/"&gt;A crash course in just-in-time (JIT) compilers - Mozilla Hacks - the Web developer blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/javascript-under-the-hood-v8/"&gt;How JavaScript Works: Under the Hood of the V8 Engine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mathiasbynens.be/notes/shapes-ics"&gt;JavaScript engine fundamentals: Shapes and Inline Caches&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This content was first published by me &lt;a href="https://www.linkedin.com/posts/aditya-vivek-thota_javascript-interview-code-activity-6914226389038624768-EhcZ?utm_source=linkedin_share&amp;amp;utm_medium=member_desktop_web"&gt;here&lt;/a&gt;.&lt;/p&gt;




</description>
      <category>javascript</category>
      <category>web</category>
      <category>googlechrome</category>
      <category>interviewquestions</category>
    </item>
    <item>
      <title>How do web browsers work? A super-simplified summary</title>
      <dc:creator>Aditya Vivek Thota</dc:creator>
      <pubDate>Sun, 25 Sep 2022 09:22:42 +0000</pubDate>
      <link>https://dev.to/xq_is_here/how-do-web-browsers-work-a-super-simplified-summary-5cn3</link>
      <guid>https://dev.to/xq_is_here/how-do-web-browsers-work-a-super-simplified-summary-5cn3</guid>
      <description>&lt;h4&gt;
  
  
  Explained in 4 mins 💡
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JesPwbT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/940/1%2AGIXp2sgN1DRUP5GAcpiefw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JesPwbT3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/940/1%2AGIXp2sgN1DRUP5GAcpiefw.png" alt="" width="880" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What really happens when you type medium.com into the web browser and press enter? How is the website loading all the information and images?&lt;/p&gt;

&lt;p&gt;Let’s find out.&lt;/p&gt;

&lt;p&gt;I will explain this by telling you a small story.&lt;/p&gt;

&lt;p&gt;The title of this story is &lt;strong&gt;Browser-Man&lt;/strong&gt; 🦸 &lt;strong&gt;: Across the Internet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One day, your friendly neighborhood Browser-Man received a request from a little kid. The kid loved reading blogs and wanted to visit medium.com to read more but he can’t do it by himself. He sought the help of Browser-Man, who needs to go and find where medium.com is, get the information it holds and then show it to the little kid.&lt;/p&gt;

&lt;p&gt;Browser-Man has a superpower. He can communicate across the Internet, a multiverse of websites where almost anything and everything is possible. Browser-Man knows that medium.com is somewhere on the internet. The internet has its own version of Nick Fury who knows the address of all things on the internet. His name is DNS Fury. Browser-Man fires a signal to the DNS Fury saying, “Hey, can you tell me where medium.com is?”&lt;/p&gt;

&lt;p&gt;DNS Fury looked into his address book and replied, “Yo, this is the address: 162.159.152.4".&lt;/p&gt;

&lt;p&gt;Browser-Man sets up a connection to this address and sends a request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;“Hi there! A little kid here wants access to you. Send me your data and I will show it to them”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The address where medium.com is hosted receives and checks this request. If all looks good, it will send a response, “Cool! Here’s my data”.&lt;/p&gt;

&lt;p&gt;Browser-Man successfully gets the data and then he looks into it and decides on how to show it to the little kid. Alas, the data looks very complicated with so many words, tags, images, etc. Browser-Man has something that can help him with this- &lt;strong&gt;The Rendering Engine&lt;/strong&gt;. He uses it to successfully render the user interface page to show to the little kid.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Post credit question: **How does your web browser run JavaScript?**
Browser-Man will be back to answer that. #StayTuned
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok, that’s a super oversimplification of how it happens, but you get the point, I hope. Let us reiterate the flow and I’ll point out a few additional points that are important. Some basic understanding of the internet, network, and web keywords are needed to understand the below details.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user types URL into the browser address bar. The URL contains the domain name (like medium.com), the protocol to use (https) and the resource to fetch ~say a specific webpage.&lt;/li&gt;
&lt;li&gt;The browser needs the IP address of this domain to send a request. If it is already there in a cache (like browser cache, OS cache, network cache), it picks it up from there. Else, the browser contacts the DNS (Domain Name System) server and this happens :P&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fqgliPNN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/242/1%2A_KBLZoMLHfTHLbKDGsv4mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fqgliPNN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/242/1%2A_KBLZoMLHfTHLbKDGsv4mw.png" alt="" width="242" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the browser has the IP Address, it will establish a connection with the server hosted at that IP address and send the request to get the required data.&lt;/li&gt;
&lt;li&gt;The browser gets the data in HTML format which it needs to parse and put into a Document Object Model (DOM). DOM is basically an internal representation of HTML data used to render the page.&lt;/li&gt;
&lt;li&gt;Similarly, a CSSOM tree is built, which includes all the CSS and styling data required to render the page. Both parsing and rendering are done by the rendering engine. The process of displaying content on the UI is literally called Painting.&lt;/li&gt;
&lt;li&gt;The browser engine helps process these actions between the UI and rendering engine.&lt;/li&gt;
&lt;li&gt;There’s a lot more happening behind the scenes. JavaScript parsing, running these scripts, data storage, and so forth.&lt;/li&gt;
&lt;li&gt;Also, how does the browser bring interactivity to life? Scripts can be used to modify the elements of the DOM to do the same.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s catch up on some finer details in a future blog. This is your one-shot revision to how browsers run, a famous interview question asked by many firms out there.&lt;/p&gt;

&lt;p&gt;I write this blog post for my own revision and retention too. In case you need clarity on something or find some errata in my understanding, feel free to let me know and I’ll update accordingly.&lt;/p&gt;

&lt;p&gt;There is an amazing blog about how websites render and paint the UI you can read for more in-depth info.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.html5rocks.com/en/tutorials/internals/howbrowserswork"&gt;How Browsers Work: Behind the scenes of modern web browsers - HTML5 Rocks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read this other blog to revise the networking side of this process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/mobile/what-happens-when-you-type-a-url-into-your-browser/"&gt;What happens when you type a URL into your browser? | Amazon Web Services&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This blog post was first published by me on Medium &lt;a href="https://medium.com/the-research-nest/how-do-web-browsers-work-a-super-simplified-summary-52b5cc8d59ce"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>web</category>
      <category>softwareengineering</category>
      <category>internet</category>
      <category>softwareinterview</category>
    </item>
    <item>
      <title>A quick revision of some important JavaScript array functions using practical examples</title>
      <dc:creator>Aditya Vivek Thota</dc:creator>
      <pubDate>Tue, 29 Mar 2022 04:02:40 +0000</pubDate>
      <link>https://dev.to/xq_is_here/a-quick-revision-of-some-important-javascript-array-functions-using-practical-examples-2k7p</link>
      <guid>https://dev.to/xq_is_here/a-quick-revision-of-some-important-javascript-array-functions-using-practical-examples-2k7p</guid>
      <description>&lt;h2&gt;
  
  
  Reduce, Filter, Includes, Map, ForEach
&lt;/h2&gt;

&lt;p&gt;One of the fundamental things we do in frontend development is to fetch the data from an API, do some operations or check for something in it and then display it on the UI.&lt;/p&gt;

&lt;p&gt;This data is generally read as a JSON or an array of JSON. Some of the most common operations we try to perform on this data are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extracting values meeting certain conditions using the Filter function.&lt;/li&gt;
&lt;li&gt;Computing a value across an array using the Reduce function.&lt;/li&gt;
&lt;li&gt;Modifying, creating, or comparing objects/values by iterating over the array using &lt;code&gt;Map&lt;/code&gt; or &lt;code&gt;ForEach&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Perform some operations with data to get some required results that are to be displayed on the UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s take an example to quickly understand how to properly use these Javascript functions. Let’s say we are trying to build some UI dashboard showing cryptocurrency data that we get from Coinbase’s public APIs. Below is the kind of real data you might actually deal with in many different use cases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**First API**
Sample JSON response from Coinbase's currency API.
(https://api.coinbase.com/v2/currencies)
Note: This is just a sample. Actual response is much larger.

This API returns a list of currencies and their ids 

{
  "data" : [
    {
      "id" : "AED",
      "name" : "United Arab Emirates Dirham",
      "min_size" : "0.01000000"
    },
    {
      "id" : "AFN",
      "name" : "Afghan Afghani",
      "min_size" : "0.01000000"
    },
    {
      "id" : "ALL",
      "name" : "Albanian Lek",
      "min_size" : "0.01000000"
    },
    {
      "id" : "AMD",
      "name" : "Armenian Dram",
      "min_size" : "0.01000000"
    },
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s another API that gives the exchange rate for the corresponding currency code with Bitcoin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**Second API**
Sample JSON response from Coinbase's exchange rate API
https://api.coinbase.com/v2/exchange-rates?currency=BTC

{
  "data" : {
    "currency" : "BTC",
    "rates" : {
      "AED" : "36.73",
      "AFN" : "589.50",
      "ALL" : "1258.82",
      "AMD" : "4769.49",
      "ANG" : "17.88",
      "AOA" : "1102.76",
      "ARS" : "90.37",
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What kind of things we might need to do with this data?&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Filter and Includes
&lt;/h3&gt;

&lt;p&gt;Filter can be used whenever you want to check if some condition is satisfied for each item in the array and if yes, put them in a new array.&lt;/p&gt;

&lt;p&gt;In our example, we want to get the currency code objects of a list of predetermined currencies from the entire list and you want to use those currency codes alone to render something.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// These currencies could be configured elsewhere.

requiredCurrencies = ['US Dollar', 'Indian Rupee', 'Japanese Yen']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we would want to filter the currency codes from the big JSON list (first API) where the currency belongs to our required list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here, we assume data is the array of JSONs we get in the API response object.

filteredData = data.filter((item) =&amp;gt; requiredCurrencies.includes( item.name))

// Filtered data output
[
    {
        "id": "INR",
        "name": "Indian Rupee",
        "min_size": "0.01000000"
    },
    {
        "id": "JPY",
        "name": "Japanese Yen",
        "min_size": "1.00000000"
    },
    {
        "id": "USD",
        "name": "US Dollar",
        "min_size": "0.01000000"
    }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The arrow notation is a convenient way to write inline functions like the one above. Also, notice the use of &lt;code&gt;array.includes()&lt;/code&gt; function. It will return true if the given array contains the value we pass to it.&lt;/p&gt;

&lt;p&gt;In our case, if the currency name is in the required currencies, the filter function will add that currency object to the filteredData.&lt;/p&gt;

&lt;p&gt;Alternatively, if you want to use a return statement in the arrow notation, you can use curly braces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;filteredData2 = data.filter((item) =&amp;gt; 
    {
        console.log('test');
        return requiredCurrencies.includes(item.name)
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach is applicable to any situation where you plan to return a value while using arrow notation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Map and ForEach
&lt;/h3&gt;

&lt;p&gt;Now, we want to create an array of label-value pairs from the data. Let the label be the currency name and the value be the current BTC exchange rate for that currency.&lt;/p&gt;

&lt;p&gt;We may need such label-value pairs to pass it on to a dropdown select box or some radio/checkbox options.&lt;/p&gt;

&lt;p&gt;Let’s assume currencies is the JSON array of all currency codes and rates is the JSON array of the exchange rates for the corresponding currency codes (check the second API). We can get our label value pairs as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LabeledData = currencies.map((item) =&amp;gt; {
    return {
        label: item['name'],
        value: rates[item.id]
        }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, &lt;code&gt;array.map&lt;/code&gt; executes a function and returns a value for each item of the array. These values are stored in a new array. Here’s what the mapped LabeledData looks like (Showing only the first few items).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {
        "label": "United Arab Emirates Dirham",
        "value": "3.673"
    },
    {
        "label": "Afghan Afghani",
        "value": "88.499983"
    },
    {
        "label": "Albanian Lek",
        "value": "111.05"
    },
    {
        "label": "Armenian Dram",
        "value": "488.092713"
    },
    {
        "label": "Netherlands Antillean Gulden",
        "value": "1.80142"
    },
    {
        "label": "Angolan Kwanza",
        "value": "450.646"
    },
    {
        "label": "Argentine Peso",
        "value": "110.698001"
    },
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can now be conveniently passed on to a component like a select box or used in some UI rendering. &lt;code&gt;ForEach()&lt;/code&gt; can also be used in the exact same way, the difference being, it modifies the original array with returned values and no new array is created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Reduce
&lt;/h3&gt;

&lt;p&gt;Let’s say we have a portfolio JSON which consists of all the cryptocurrencies owned by a user. We want to calculate and show the net worth of their crypto portfolio in USD. Assume you have the USD exchange rate for each cryptocurrency within this JSON.&lt;/p&gt;

&lt;p&gt;(Values are dummy values)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;portfolio = [
    {
        "label": "BTC",
        "quantity": 3,
        "rate": 200,
    },
    {
        "label": "ETH",
        "quantity": 5,
        "rate": 100,
    },
    {
        "label": "LUNA",
        "quantity": 2,
        "rate": 50,
    },
    {
        "label": "SOL",
        "quantity": 10,
        "rate": 10,
    },
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple observation tells us this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netWorth = sum(quantity * rate)
netWorth = 3*200 + 5*100 + 2*50 + 10*10 = $ 1300
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same operation can be performed on an array using the reduce() function as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;initial = 0; //Declare an initial value

netWorth = portfolio.reduce((netValue, item) =&amp;gt; netValue + item.quantity*item.rate, initial);

// This computes to networth = 1300
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, you can compute a single value across the array. The function also takes an initial value to start with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;array.filter((item) =&amp;gt; some condition);&lt;/code&gt; is used to extract items from an array meeting specific conditions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;array.includes(value)&lt;/code&gt; returns True if the value is present in the given array.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;array.map((item) =&amp;gt; some function);&lt;/code&gt; executes the given function on each item of the array and the corresponding results are stored in a new array.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;array.forEach((item) =&amp;gt; some function);&lt;/code&gt; does the same thing as array.map but it modifies the existing array and does not create a new one.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;array.reduce((value, item) =&amp;gt; some function/operation, initialValue);&lt;/code&gt; executes the given function for each item in the array and passes on the return value to the next iteration. This way, the return value can be accessed and updated at each iteration giving a final value at the end of the loop.&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>json</category>
      <category>frontend</category>
      <category>arrays</category>
    </item>
  </channel>
</rss>
