<?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: sah-shah7</title>
    <description>The latest articles on DEV Community by sah-shah7 (@sahshah7).</description>
    <link>https://dev.to/sahshah7</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%2F710636%2Ffc55573d-9981-41e7-b431-85ee8abf49c1.png</url>
      <title>DEV Community: sah-shah7</title>
      <link>https://dev.to/sahshah7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sahshah7"/>
    <language>en</language>
    <item>
      <title>Array Of Objects - Part 2</title>
      <dc:creator>sah-shah7</dc:creator>
      <pubDate>Sun, 26 Sep 2021 10:56:15 +0000</pubDate>
      <link>https://dev.to/sahshah7/array-of-objects-part-2-3o0f</link>
      <guid>https://dev.to/sahshah7/array-of-objects-part-2-3o0f</guid>
      <description>&lt;p&gt;This is in continuation , if you haven’t read Part 1 , please go through it(2 min read) before starting this one.&lt;/p&gt;

&lt;p&gt;In the last part we dealt with creation of Array,json, and array of objects. In this part , we’ll cover the popular array methods, how to loop through array of objects.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Starting with using array functions on array of Object!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For this part , we’ll be using the same array of objects, but modifying  its contents.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i6AyVHyK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7s6nwnvh3kuwygeh5yt.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i6AyVHyK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7s6nwnvh3kuwygeh5yt.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here some methods such as unshift(), push() and splice() and how they function is shown in the picture above&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A short summary :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.unshift(variable or object) adds a new object in the beginning&lt;/li&gt;
&lt;li&gt;.push(variable or object) adds a new object at the end.&lt;/li&gt;
&lt;li&gt;.splice({index where to start},{how many items to remove},{items to add}) can be used to insert object at any index in the array.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Looping Through an Array of Objects
&lt;/h1&gt;

&lt;p&gt;Knowing how to loop through the array is very important to perform search and filtering.&lt;br&gt;
Let’s start with a challenge, &lt;em&gt;Find all the objects whose rating is above or equal to 50&lt;/em&gt;&lt;br&gt;
For that we will need to loop through each object.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--thYOTzdl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9y5hz7u2bjl6i56z9u5.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--thYOTzdl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9y5hz7u2bjl6i56z9u5.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the objects with rating &amp;gt;= 50 were returned. Looping through an array of objects is the same as the index of a normal array. Additionally we’ll have to add the key name for which we want the value.&lt;br&gt;
Another way of searching and filtering can be done by array.find() for searching, array.filter() for filtering where in multiple conditions can be used.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Array of Objects-Part 1</title>
      <dc:creator>sah-shah7</dc:creator>
      <pubDate>Sat, 25 Sep 2021 11:50:00 +0000</pubDate>
      <link>https://dev.to/sahshah7/array-of-objects-1m0a</link>
      <guid>https://dev.to/sahshah7/array-of-objects-1m0a</guid>
      <description>&lt;p&gt;Very much like a normal array, but it’s like inception &lt;strong&gt;[ {object inside object(array) } ]&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  You may wonder , what is an array?
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8FNuALpg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o8nh427twbi2utcg5fpp.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8FNuALpg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o8nh427twbi2utcg5fpp.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An array is a data structure which can store multiple items and that item can be accessed by using the index number!&lt;/p&gt;

&lt;p&gt;Let’s start with creating an array!&lt;/p&gt;

&lt;p&gt;Now that we know the syntax of creating a new array , let’s try creating a javascript object ,which is also called JSON.&lt;/p&gt;

&lt;p&gt;Javascript Object notation is used to represent the data in a structured format based on Javascript object syntax.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gP2k4rrX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07v6497totozye2aqe75.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gP2k4rrX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07v6497totozye2aqe75.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know how to create JSON and access its data, Next step would be to implement this idea where we combine arrays and json together!&lt;/p&gt;

&lt;p&gt;Let’s modify the array and re-write it with  json objects inside it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_uoFdTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n65bxbqt5o1skkyp9fam.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_uoFdTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n65bxbqt5o1skkyp9fam.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here there are 5 objects inside the array. If we want to access the object containing Java, we use the index number 1 as we use in an array. Next we have stored the whole object inside a variable object. Moving on, to access the value from the key “ Java” , the syntax is given on line 9. To access the key of an object, we can use the inbuilt method as shown in line 13. &lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
