<?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: Zoheb Ahmed</title>
    <description>The latest articles on DEV Community by Zoheb Ahmed (@oneknucklehead).</description>
    <link>https://dev.to/oneknucklehead</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%2F601884%2F2dbc2494-dc33-4399-a339-10b5e4493208.jpg</url>
      <title>DEV Community: Zoheb Ahmed</title>
      <link>https://dev.to/oneknucklehead</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oneknucklehead"/>
    <language>en</language>
    <item>
      <title>NFTs explained:</title>
      <dc:creator>Zoheb Ahmed</dc:creator>
      <pubDate>Mon, 15 Aug 2022 21:16:14 +0000</pubDate>
      <link>https://dev.to/oneknucklehead/nfts-explained-3n4o</link>
      <guid>https://dev.to/oneknucklehead/nfts-explained-3n4o</guid>
      <description>&lt;p&gt;If you are one of those people who is completely overwhelmed by these latest terminologies like web3, metaverse and NFTs, then believe me, You’re not alone.&lt;/p&gt;

&lt;p&gt;Recently, there has been a huge hype among the tech enthusiasts with the upcoming web3, metaverse and decentralized dapps and there has been huge speculative fever surrounding NFTs, especially. You must have seen people paying a huge load of their money just to buy a piece of art that looks very similar to a downloadable JPEG file.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;But what exactly is an NFT?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;NFTs are a digital commodity, which can represent anything like art, music, basketball or maybe a quote that you tweeted. These are assets that can be sold or bought just like a piece of property. And all of these make use of the blockchain technology, quite similar to Bitcoin/Ethereum, to create a special string of code that represents something which cannot be replaced or recreated. They exist on blockchains as tokens which have properties like digital ownership and complete transparency.&lt;/p&gt;

&lt;p&gt;If you are unfamiliar with the term blockchain, you might want to look into this video. Basically, blockchain is like a distributed ledger, which stores all the transactions along with all the details belonging to that transaction. This information is stored permanently and no one has the authority to tamper with it.&lt;/p&gt;

&lt;p&gt;NFT stands for Non fungible tokens. The most vague way of understanding NFTs is to think of it as a file format. Just like people make use of file formats like jpg, mp3, gif to transfer valuable information on the internet, NFTs are also similar to it. Just like we make use of the mp3 file format to transfer and download music from the internet and jpg file format to transfer graphics or images across the internet. Similar to this, NFTs are a special file format that transfers data along with a value on the blockchain network, let’s say Ethereum.&lt;/p&gt;

&lt;p&gt;I’ll be listing down some resources at the end in order to provide more clarity to these concepts. By now, you should know that NFTs “live” on blockchains and are simply pieces of unique information that is written permanently on the blockchain that can be sold and traded.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;But how are NFTs different from a normal downloadable file?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;NFTs are primarily a digital asset that belongs to you, and ONLY you. Digital ownership is one of the main characteristics of an NFT among all the other characteristics. These can literally prove the authenticity and ownership of digital goods.&lt;/p&gt;

&lt;p&gt;Let’s compare a picture of a flower and a flower NFT. The picture of this flower is not unique and can be downloaded easily from anywhere on the internet. One simple google search, and boom, you have your flower. And you can easily make copies of this file and then reupload them on the internet. Thus uniqueness and authenticity is lost. Meanwhile a flower NFT is unique i.e if you are the person who has bought the NFT, your ownership will be embedded onto the blockchain as a proof of authenticity and will remain on the blockchain for ever and ever! Even if someone tries to make copies of your NFT, your ownership on the blockchain can act as a proof of your ownership and since it is stored on the blockchain, you do not have to worry about someone else trying to tamper your ownership. Thus, Unique and one of a kind!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Non Fungible vs Fungible tokens:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A fungible asset is basically a resource whose unit can be exchanged as and when necessary. A fungible object is something which can be replaced by some other object which is identical or substitutable. For example you can trade your 1$ for an object whose worth is the same, or you can trade your 1$ in exchange of other currencies, or you would not mind if someone took your 100$ bill and gave back two 50$ bills because the worth remains constant.&lt;/p&gt;

&lt;p&gt;However, non fungible items are unique, which cannot be interchanged or substituted. For example you cannot exchange your house with someone else's house because you know that no matter how similar the house looks. Even if the other house looks exactly the same and has the exact same paint, entrance, exit, interiors, but still the location, the place where the other house is built, the roads that lead to the house, the way light enters the house, or something else would still remain unique, Unique to each one of them. Another example of non fungible tokens could be your identity verification documents like a government issued certificate, which is unique, non interchangeable and one of a kind. In a similar way, every NFT has unique properties and isn’t worth the same amount as other similar tokens.&lt;/p&gt;

&lt;p&gt;Fun fact, cryptocurrencies are fungible. Just clearing up another doubt that you may have.&lt;/p&gt;

&lt;p&gt;Now the obvious question that arises is, How to buy them? And where to sell them?&lt;/p&gt;

&lt;p&gt;Just like you can buy stocks on various platforms, you can buy NFTs too. The NFTs are mostly sold on marketplaces which is just an online store that allows you to buy and sell NFTs. Think of it as OLX, but with blockchain technology. You can buy and sell NFTs using Ethereum tokens i.e. by paying through your crypto wallet in Ethereum.&lt;/p&gt;

&lt;p&gt;There are a number of famous marketplaces where you can list your own NFTs and trade them. Here’s a list of some of them: &lt;a href="https://opensea.io/"&gt;Opensea&lt;/a&gt;, &lt;a href="https://crypto.com/nft/"&gt;Crypto.com&lt;/a&gt;, &lt;a href="https://rarible.com/"&gt;Rarible&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But how does selling an NFT work? Wasn’t NFT unique and non interchangeable?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, selling an NFT implies giving up your ownership and passing on the ownership of the NFT to someone else who is willing to buy the NFT at a fair price. The NFTs you buy are stored into your crypto wallet and are added to your account address. Before you get into buying and selling NFTs, it is recommended to gain some trading knowledge in order to add Ethereum into your wallet and stuff like that.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Importance of NFTs and their use cases:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;NFTs have a lot of scope in the field of gaming. Normally, in a centralized game, the items that you buy including the swords, skins, characters are connected to an account or an email ID. All of these items are lost once you lose access to your account, or if your game shuts down. But since NFTs live on the blockchain, these in-game items and special royalties can be turned into exclusive NFTs, which once bought, stays with you forever, linked to your wallet address.&lt;/p&gt;

&lt;p&gt;And not only in gaming, people all over the world have been spending a huge load of money on NFT collectibles ranging from Pokémon cards, to digital houses, AR sneakers, paintings, avatars etc.&lt;/p&gt;

&lt;p&gt;Thus, NFTs have now become a replacement to items which were earlier physically collected. As of now, instead of buying a huge oil painting, you can now just get a digital file of the painting itself which you can store in a pendrive!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The future of NFTs:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It seems that a lot of artists, creators, designers from all around the world have accepted this technology and are moving into making their own NFTs. Artists like Rowan Atkinson and entrepreneurs like Gary Vaynerchuk have already made their way into the NFT world.&lt;/p&gt;

&lt;p&gt;Everyday, millions and billions of transactions take place in the NFT marketplaces. About 41 million NFTs were traded back in 2021 and early 2022 which summed up to 25.8 billion dollars! However, the numbers have gone down a bit post covid. All in all, the future of NFTs looks quite bright.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources and additional info:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Blockchain 101 :- &lt;a href="https://www.youtube.com/watch?v=_160oMzblY8&amp;amp;ab_channel=AndersBrownworth"&gt;Recommended&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How does a blockchain work - simply explained :- &lt;a href="https://www.youtube.com/watch?v=SSo_EIwHSd4&amp;amp;t=3s&amp;amp;ab_channel=SimplyExplained"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;What is NFT and does it have a future? :- &lt;a href="https://medium.com/whitebit/what-is-nft-does-it-have-a-future-c605ff3f7115"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Make your own NFT in just 14 lines :- &lt;a href="https://www.freecodecamp.org/news/how-to-make-an-nft/"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Web3 developer guide and resources to get started :- &lt;a href="https://blog.idrisolubisi.com/web-3-a-developer-roadmap-and-resources-to-get-started"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>web3</category>
      <category>nft</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Triple Dots of JavaScript : Spread vs Rest</title>
      <dc:creator>Zoheb Ahmed</dc:creator>
      <pubDate>Mon, 23 Aug 2021 15:00:28 +0000</pubDate>
      <link>https://dev.to/oneknucklehead/triple-dots-of-javascript-spread-vs-rest-1c7b</link>
      <guid>https://dev.to/oneknucklehead/triple-dots-of-javascript-spread-vs-rest-1c7b</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;...args&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;The above three dots followed by any variable name (here: args) is what is called the &lt;strong&gt;Spread operator&lt;/strong&gt;, and the same three dots followed by any variable name (here: args) is also called the &lt;strong&gt;Rest operator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In 2015, ES6 introduced two great features which improves the ability to handle function parameters and arrays quite easily. These are the Spread operator and the Rest parameter. Though the spread operator and the rest parameter look quite the same, their functionalities are quite different.&lt;/p&gt;

&lt;p&gt;So what’s the difference between them?&lt;br&gt;
Let’s gulp in things one at a time starting with what a Spread Operator is.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Spread operator&lt;/strong&gt; allows an object that is capable of returning its elements one at a time to expand in places where more than one argument is expected.&lt;br&gt;
It is mostly used in an array where more than 1 value is expected.&lt;br&gt;
As the name suggests, it is used to “Spread” the values contained in an object (or an array) into another array.&lt;/p&gt;
&lt;h5&gt;
  
  
  Let’s understand this with an example:
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = ["the", "Butter"];
let b = ["the", "Jam"];
console.log(["Spread",...a]);
console.log(["Spread",...b]);
console.log(["Spread",...a, "and",...b]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h5&gt;
  
  
  The above code gives the following output:
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[“Spread” , “the” , “Butter”]
[“Spread” , “the” , “Jam”]
[“Spread” , “the” , “Butter” , “and” , “the” , “Jam”]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Just like in the above example, we can also spread the properties of an object into another object as shown in the example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let oldObj = {oldData: "old data"}
console.log({
...oldObj, 
newData:"new data" 
})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  This gives the output as follows:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{oldData:"old data", newData:"new data"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main purpose of a spread operator is to expand array elements or an object's property.&lt;/p&gt;

&lt;p&gt;Thus, what the spread operator actually does is that it pulls out the values from an existing array(or an object) and “Spreads” / adds it to another new array (or an object). It’s like cloning an array/object into another array/object.&lt;/p&gt;

&lt;p&gt;On the other hand,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rest parameter&lt;/strong&gt; is an improved way to handle function parameter, allowing us to more easily handle various input as parameters in a function. The rest parameter syntax allows us to represent an &lt;strong&gt;indefinite number of arguments as an array&lt;/strong&gt;. With the help of rest parameter a function can be called with &lt;em&gt;any number of arguments&lt;/em&gt;, no matter how it was defined. &lt;/p&gt;

&lt;h5&gt;
  
  
  Let us understand this with an example:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sumNos(...args){
    sum=0;
        for(let i of args){
        sum+=i
          }
        return sum
}
console.log('The sum of the parameters passed is:', sumNos(1, 2, 3))
console.log('The sum of the parameters passed is:', sumNos(1, 2)) 
console.log('The sum of the parameters passed is:', sumNos(1, 2, 3, 4, 5, 6))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  The above example gives us the following output:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The sum of the parameters passed is: 6
The sum of the parameters passed is: 3 
The sum of the parameters passed is: 21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thus, it is clearly evident from the above example that the function sumNos can take any number of inputs as its parameter and then loops through each of its element, adds it, and returns the sum.&lt;br&gt;
It’s like an array of elements of indefinite size, being passed on to a function as its parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;br&gt;
In short, The spread operator allows us to expand &lt;strong&gt;an iterable like array into its individual elements&lt;/strong&gt; whereas The rest parameter allows us to &lt;strong&gt;pass an indefinite number of parameters to a function and access them in an array&lt;/strong&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Here are some of the best resources for you to learn more about them:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=DoIGxx7P-ps&amp;amp;t=597s"&gt;Spread and REST operators in Javascript&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=iLx4ma8ZqvQ"&gt;...spread operator and rest operator - Beau teaches JavaScript&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax"&gt;Spread syntax Documentation from Mozilla Docs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Functions/rest_parameters"&gt;Rest Parameters Documentation from Mozilla Docs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Thanks for Reading!
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Connect with me:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/oneknucklehead_"&gt;Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/oneknucklehead/"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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