<?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 Waqas on Medium]]></title>
        <description><![CDATA[Stories by Waqas on Medium]]></description>
        <link>https://medium.com/@jbonds1159?source=rss-d82d53616c4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Waqas on Medium</title>
            <link>https://medium.com/@jbonds1159?source=rss-d82d53616c4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 21 May 2026 10:33:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jbonds1159/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[Fat Arrow Function in JS]]></title>
            <link>https://medium.com/@jbonds1159/fat-arrow-function-in-js-cc4b9884534f?source=rss-d82d53616c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc4b9884534f</guid>
            <dc:creator><![CDATA[Waqas]]></dc:creator>
            <pubDate>Sat, 18 Feb 2023 23:46:41 GMT</pubDate>
            <atom:updated>2023-02-18T23:46:41.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*P6MKKaSx33P3cq1dGduo6w.png" /></figure><p>Fat Arrow (=&gt;) Syntax was Introduced in ES6, which is used to define a shorthand for a nameless function. To under Stand the syntax of Fat Arrow (=&gt;), first, let&#39;s take an example of a regular Function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*eVx342TrgHll9fXryznexA.png" /><figcaption>Simple Function for Multiplication of Two Numbers</figcaption></figure><p>In the above example, we write a simple function for multiplication with the name ‘prdct’.The output of the Function is as Fallows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*drzzIIhLEu4S-uouCErSFQ.png" /><figcaption>Output for prdct</figcaption></figure><p>The above function can be written by using Fat Arrow Syntax:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*ksjHycMITQwbTrMz6ktiOA.png" /><figcaption>Fat Arrow syntax</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc4b9884534f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Destructuring in JS]]></title>
            <link>https://medium.com/@jbonds1159/destructuring-in-js-207312192d0b?source=rss-d82d53616c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/207312192d0b</guid>
            <dc:creator><![CDATA[Waqas]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 06:28:46 GMT</pubDate>
            <atom:updated>2023-02-13T06:46:51.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*0CRIKDkwmnOy0h62SP_08Q.png" /></figure><p>In <em>this article, we will explore an array and object Destructuring with the Difference</em></p><p>Simply Destructuring means “A process of unpacking or extracting a small part of something from the main body/part so that it can be modified where needed”.</p><p>In JS There are two main types of Destructuring:</p><ol><li>Array Destructuring</li></ol><p>2. Object Destructuring</p><p><strong><em>Array Destructuring:</em></strong></p><p>In JS it is a feature that allows us to extract or unpack the elements of an array and bound them to distinct variables. Here is a simple Example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_LQ0Zf12_xx-FVBQESRvuQ.png" /></figure><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*vnYB9XslPY_ZlsiPr1MTmA.png" /></figure><p><strong><em>Object Destructuring:</em></strong></p><p>In JS it is a feature that allows us to extract or unpack the properties of an object and bind them to distinct variables. Here is a simple Example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*k6Zx7WL6wWclvwRbaSQxrw.png" /></figure><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*vEp8fNdMOwvDBlKsnjy5Bg.png" /></figure><p><strong><em>Difference Between Array Destructuring and Object Destructuring:</em></strong></p><p>Array destructuring relies on the order of values in the array, while object destructuring relies on the names of properties in the object. Array destructuring uses square brackets [] to define the pattern of values to extract, while object destructuring uses curly braces {} to define the pattern of properties to extract.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=207312192d0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mutation In Java Script]]></title>
            <link>https://medium.com/@jbonds1159/mutation-in-java-script-648ef6eeff48?source=rss-d82d53616c4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/648ef6eeff48</guid>
            <dc:creator><![CDATA[Waqas]]></dc:creator>
            <pubDate>Tue, 23 Aug 2022 02:39:49 GMT</pubDate>
            <atom:updated>2022-08-23T02:39:49.809Z</atom:updated>
            <content:encoded><![CDATA[<p>In js Mutation is changing the properties of the original value of an Object or an Array. However, in Biology mutation is the way of changing the structure of a gene and producing permanent Differences.</p><p>Let’s discuss it briefly….</p><p>There are two Data Types in js:</p><h4><strong><em>Primitive</em></strong></h4><p>Boolean, Numbers, and String Null and Undefined. They are immutable which means if we change one then a new instance is created as a result however the original value remains the same.</p><h4>Non-Primitive</h4><p>Arrays and Objects are Non-Primitive. They are mutable if we change one then no new instance will be created and properties of an original array or an object will be changed.</p><p>There are two types of Mutation in JS.</p><p><em>a) Object Mutation</em></p><p><em>b) Array Mutation.</em></p><p>Let’s Create an object in js</p><p><strong><em>const fruit={name: ’Mango’};</em></strong></p><p>In the above line name is the property of the ‘fruit’ object. If we add another Property then it is the mutation as we are changing the original form of our object ‘fruit’</p><p><strong><em>fruit. color=’Yellow’;</em></strong></p><p><strong><em>console.log(fruit);</em></strong></p><h4>Output</h4><p>{ name: ‘Mango’, color: ‘Yellow’ }</p><p>Now we create another Variable ‘newfruit’ and assign it the ‘fruit’ object</p><p><strong><em>const newfruit=fruit;</em></strong></p><p>Lets Change the color Property of ‘newfruit’ and see what happens;</p><p><strong><em>newfruit.color =’blue’;</em></strong></p><p><strong><em>console.log(fruit);</em></strong></p><h4>Output</h4><p>{ name: ‘Mango’, color: ‘blue’ }</p><p>console.log(newfruit);</p><h4>Output</h4><p>{ name: ‘Mango’, color: ‘blue’ }</p><p>Look at the last two outputs both are the same although we are changing the color property of the ‘newfruit’ object, the fruit object is changing automatically without our knowledge. In other words, by mutating the ‘newfruit’ object ‘fruit’ object mutated automatically. These unpredictable Changes can break an application and hard to fix and debug.</p><h3>Why original Object Muted</h3><p>When we create an abject, a memory location is automatically assigned to it and holds the value assigned to it. In the above example when a ‘newfruit’ object is created by using <strong><em>const newfruit=fruit;</em></strong>… the fruit object memory is shared with the ‘<strong>newfruit’ </strong>object which leads to automatically changing ‘<strong>fruit’</strong> object.</p><h3>Array Mutation</h3><p>The following is an example in which an array is reversed</p><p><strong>const Fruits=[‘Apple’,’Mango’,’Dates’,’Grapes’,’WateMellon’];</strong></p><p><strong>const newfruits=Fruits.reverse();</strong></p><p><strong>console.log(newfruits);</strong></p><h4>output</h4><p>[ ‘WateMellon’, ‘Grapes’, ‘Dates’, ‘Mango’, ‘Apple’ ]</p><p><strong>console.log(Fruits);</strong></p><h4>output</h4><p>[ ‘WateMellon’, ‘Grapes’, ‘Dates’, ‘Mango’, ‘Apple’ ]</p><p>In the above example, both outputs are the same although we are passing array ‘fruits’ to ‘newfruits’ and then reversing it yet when we print the original array[ i.e <strong>console.log(Fruits); ]</strong>we found that its elements are reversed automatically. This is an array mutation.</p><p>Here is another example of reversing an array without changing original array, which means without mutation.</p><p><strong>const Fruits1=[‘Apple’,’Mango’,’Dates’,’Grapes’,’WateMellon’];</strong></p><p><strong>const newfruits1=Fruits1.slice().reverse();</strong></p><p><strong>console.log(newfruits1);</strong></p><h4>output</h4><p>[ ‘WateMellon’, ‘Grapes’, ‘Dates’, ‘Mango’, ‘Apple’ ]</p><p>console.log(Fruits1);</p><h4>output</h4><p>[ ‘Apple’, ‘Mango’, ‘Dates’, ‘Grapes’, ‘WateMellon’ ]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=648ef6eeff48" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>