<?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: Naveen Kumar Chintakindi</title>
    <description>The latest articles on DEV Community by Naveen Kumar Chintakindi (@naveen1995113).</description>
    <link>https://dev.to/naveen1995113</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%2F837566%2Fbad97d2e-17d2-4e16-a976-fc5cf3ccffbd.jpeg</url>
      <title>DEV Community: Naveen Kumar Chintakindi</title>
      <link>https://dev.to/naveen1995113</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/naveen1995113"/>
    <language>en</language>
    <item>
      <title>polyfill: Array.Map()</title>
      <dc:creator>Naveen Kumar Chintakindi</dc:creator>
      <pubDate>Wed, 19 Apr 2023 15:56:14 +0000</pubDate>
      <link>https://dev.to/naveen1995113/polyfill-arraymap-4bd2</link>
      <guid>https://dev.to/naveen1995113/polyfill-arraymap-4bd2</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const original_Arr=[1,2,3];

Array.prototype.myMap=function(cb){
  let argArr=this; 
  let output_Arr=[];
  for(let i=0;i&amp;lt;argArr.length;i++){
    const value=cb(argArr[i],i,argArr);
    output_Arr.push(value);
  }
  return output_Arr;
}

const new_Arr=original_Arr.myMap((element,index,arr)=&amp;gt;{
  return element*2;
});

console.log(newArr); //[2,4,6]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In the above method we used array prototype(i.e., &lt;code&gt;Array.prototype.myMap()&lt;/code&gt;) to create a custom &lt;code&gt;Array.map()&lt;/code&gt; method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As shown above &lt;code&gt;this&lt;/code&gt; refer to the actual array on which we are running the &lt;code&gt;myMap()&lt;/code&gt;. Here, &lt;code&gt;this&lt;/code&gt; refers to &lt;code&gt;original_Arr[]&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
