<?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 Johnhoro on Medium]]></title>
        <description><![CDATA[Stories by Johnhoro on Medium]]></description>
        <link>https://medium.com/@johnhoro125?source=rss-db769239278c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*w0Z-U93FzApMUIy1</url>
            <title>Stories by Johnhoro on Medium</title>
            <link>https://medium.com/@johnhoro125?source=rss-db769239278c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:20:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnhoro125/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[Mostly use JavaScript Array methods]]></title>
            <link>https://medium.com/@johnhoro125/mostly-use-javascript-array-methods-40e1af97ded5?source=rss-db769239278c------2</link>
            <guid isPermaLink="false">https://medium.com/p/40e1af97ded5</guid>
            <category><![CDATA[array-methods]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Johnhoro]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 12:52:33 GMT</pubDate>
            <atom:updated>2022-02-10T12:52:33.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. map()</h3><p>It returns a new array containing the results of calling a function on every element in this array.</p><pre>var array1 = [1, 2, 9, 16];</pre><pre>// pass a function to map<br>var map1 = array1.map(x =&gt; x * 3);</pre><pre>console.log(map1);<br>// expected output: Array [3, 6, 27, 48]</pre><h3>2. <strong>forEach</strong>()</h3><p>It calls a function for each element in the array.</p><pre>var array1 = [&#39;x&#39;, &#39;y&#39;, &#39;z&#39;];</pre><pre>array1.forEach(element =&gt; console.log(element));</pre><pre>// expected output: &quot;x&quot;<br>// expected output: &quot;y&quot;<br>// expected output: &quot;z&quot;</pre><h3>3. filter()</h3><p>It returns a new array containing all elements of the calling array for which the provided filtering function returns true.</p><pre>var array = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];</pre><pre>var result = array.filter((elm)=&gt; elm &gt;5);</pre><pre>console.log(result);<br>// expected output: Array [6, 7, 8, 9, 10, 11, 12, 13]</pre><h3>4. includes()</h3><p>It determines whether the array contains a value, returning true or false .</p><pre>var pets = [&#39;cat&#39;, &#39;dog&#39;, &#39;bat&#39;];</pre><pre>console.log(pets.includes(&#39;cat&#39;));<br>// expected output: true</pre><h3>5. splice()</h3><p>It adds and/or removes elements from an array.</p><pre>var months = [&#39;Jan&#39;, &#39;March&#39;, &#39;April&#39;, &#39;June&#39;];<br>months.splice(1, 0, &#39;Feb&#39;);<br>// inserts at index 1<br>console.log(months);<br>// expected output: Array [&quot;Jan&quot;, &quot;Feb&quot;, &quot;March&quot;, &quot;April&quot;, &quot;June&quot;]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40e1af97ded5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>