<?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: Rakesh Patel</title>
    <description>The latest articles on DEV Community by Rakesh Patel (@rakesh_patel).</description>
    <link>https://dev.to/rakesh_patel</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%2F694191%2Ff1a91c90-864a-4407-b1a7-35772d4243e8.jpeg</url>
      <title>DEV Community: Rakesh Patel</title>
      <link>https://dev.to/rakesh_patel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rakesh_patel"/>
    <language>en</language>
    <item>
      <title>Set Data Structure in JavaScript</title>
      <dc:creator>Rakesh Patel</dc:creator>
      <pubDate>Sat, 22 Jan 2022 19:12:03 +0000</pubDate>
      <link>https://dev.to/rakesh_patel/set-data-structure-in-javascript-27o1</link>
      <guid>https://dev.to/rakesh_patel/set-data-structure-in-javascript-27o1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Map, WeakMap, Set&lt;/strong&gt; and &lt;strong&gt;WeakSet&lt;/strong&gt; these 4 are new Data structure which was introduced in ES6.&lt;/p&gt;

&lt;p&gt;Before diving deep into these DS, let's first understand &lt;strong&gt;What is DS?&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Data structures, at a high level, are techniques for storing and organizing data that make it easier to modify, navigate, and access.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Data structures are like container, which hold data ( primitive, object, etc.) and these container's have their own constraint/rule/pattern to access, modify, delete their data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;DS are not limited to particular programming language only. Data structures are used in almost all areas of computer science and programming, from operating systems to basic vanilla code to artificial intelligence.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, let's come to our topic,&lt;/p&gt;

&lt;p&gt;Before Set &amp;amp; Map, JavaScript only have inbuild &lt;strong&gt;&lt;em&gt;Array&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Object&lt;/em&gt;&lt;/strong&gt; DS. but in some scenarios this both not perform well and we needed to manually add extra functionality for getting things done. and therefore this new DS are introduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Set
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Set&lt;/strong&gt;&lt;/em&gt; DS hold only unique data. so Set guaranteed of no data is duplicated.&lt;/p&gt;

&lt;p&gt;E.g. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TZoaFqGc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w35ycmbsoi4tup2jpseg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TZoaFqGc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w35ycmbsoi4tup2jpseg.png" alt="Set Demo" width="880" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In above example, we have passed array of duplicate values to Set constructor but when we logged Set value, it returned only object with unique value's&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Note : Set is object type not array type. that's why return value is object.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In above example, I used shortcut way of initialization of Set via array. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set"&gt;click here&lt;/a&gt; to read more detailed information of Set&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set are implemented with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols"&gt;Iterator protocol&lt;/a&gt; [Symbol.iterator] that means Set are by default Iterable object. so we can iterate the Set value with &lt;strong&gt;&lt;em&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of"&gt;for...of&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt; loop&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dSXVNYf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p29ah8rhr356pvqahiup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dSXVNYf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p29ah8rhr356pvqahiup.png" alt="Iterating Set" width="880" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantage's of Set over Array
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set hold only unique data (no duplicate value are allowed)&lt;/li&gt;
&lt;li&gt;Time Complexity of searching element in &lt;strong&gt;&lt;em&gt;Set&lt;/em&gt;&lt;/strong&gt; is constant i.e. &lt;strong&gt;&lt;em&gt;O(1)&lt;/em&gt;&lt;/strong&gt;. where as in Array it's linear i.e. &lt;strong&gt;&lt;em&gt;O(n)&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real time Application
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Suppose you have user list. where some user's name are repeated. then with the help of &lt;strong&gt;&lt;em&gt;Set&lt;/em&gt;&lt;/strong&gt; you can easily remove duplicate name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ULgoI9vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9x95wbrcaa6jpe4u9o2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ULgoI9vj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9x95wbrcaa6jpe4u9o2u.png" alt="username demo" width="880" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Searching for particular user name in huge list ( e.g. 5_00_000 records) because with array it take time &lt;strong&gt;&lt;em&gt;O(n)&lt;/em&gt;&lt;/strong&gt; complexity. but with &lt;strong&gt;&lt;em&gt;Set&lt;/em&gt;&lt;/strong&gt; we can quickly find user name &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sefse_DJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9va7ucpoge9zmt1v2lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sefse_DJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9va7ucpoge9zmt1v2lg.png" alt="Time complexity" width="880" height="671"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;(output in time may varies machine to machine)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Refernces :
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://exploringjs.com/es6/ch_maps-sets.html"&gt;https://exploringjs.com/es6/ch_maps-sets.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/how-to-use-javascript-collections-map-and-set/"&gt;https://www.freecodecamp.org/news/how-to-use-javascript-collections-map-and-set/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Getter &amp; Setter in JavaScript</title>
      <dc:creator>Rakesh Patel</dc:creator>
      <pubDate>Sat, 08 Jan 2022 11:52:52 +0000</pubDate>
      <link>https://dev.to/rakesh_patel/getter-setter-in-javascript-3jd3</link>
      <guid>https://dev.to/rakesh_patel/getter-setter-in-javascript-3jd3</guid>
      <description>&lt;p&gt;Getter and Setter are property which are defined inside object/classes. both are the type of function, by which we can get and set value of property in object.&lt;/p&gt;

&lt;p&gt;Before going to details of Getter &amp;amp; Setter, first let see why do we need this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we need?
&lt;/h2&gt;

&lt;p&gt;suppose you have following Student object,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Student = {
  name : 'Getter',
  marks : {
    python : 80,
    js: 85,
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you want to calculate total marks. &lt;br&gt;
some of the way to get total marks are,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;const total = Student.marks.python + Student.marks.js;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;creating &lt;strong&gt;getTotalMarks&lt;/strong&gt; method in Student object&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Student = {
  name : 'Getter',
  marks : {
    python : 80,
    js: 85,
  },
  getTotalMarks() {
    return this.marks.python + this.marks.js
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;and by calling &lt;strong&gt;Student.getTotalMarks()&lt;/strong&gt; we will get the total marks&lt;/p&gt;

&lt;p&gt;Above solution works. but syntax is not cleaner ( &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#smart_self-overwriting_lazy_getters"&gt;Getter &amp;amp; Setter have many advantages over traditional method&lt;/a&gt; ). How if we get total marks, simple as property name? like &lt;strong&gt;Student.totalMarks&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Here getter are come into picture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Student = {
  name : 'Getter',
  marks : {
    python : 80,
    js: 85,
  },
  get getTotalMarks() {
    return this.marks.python + this.marks.js
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and now we can get total marks simply as,&lt;br&gt;
&lt;code&gt;const total = Student.getTotalMarks;&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Getter :
&lt;/h2&gt;

&lt;p&gt;below is the description of Getter from MDN,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sometimes it is desirable to allow access to a property that returns a dynamically computed value, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls. In JavaScript, this can be accomplished with the use of a getter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Getter function are declared with &lt;strong&gt;get&lt;/strong&gt; keyword,&lt;br&gt;
e.g :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    get functionName() {}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"&gt;Click here&lt;/a&gt; to read more about Getter&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Setter
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;all properties/advantages of &lt;strong&gt;Setter&lt;/strong&gt; are same as &lt;strong&gt;Getter&lt;/strong&gt;. Except Getter are used to get computed value from object where as &lt;strong&gt;Setter&lt;/strong&gt; are used to set desirable value to property.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setter function are declared with &lt;strong&gt;set&lt;/strong&gt; keyword,&lt;br&gt;
e.g. :&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   set functionName() {}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Below is sample program using Setter,
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Student = {
  name : 'Setter',
  marks : {
    python : 80,
    js: 85,
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, suppose we want to ensure that user must enter marks between 0 - 100. so, for this we can use Setter function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let Student = {
  name: "Setter",
  marks: {
    python: 80,
    js: 85,
  },
  set pythonMarks(mark) {
      if(mark &amp;lt;= 100 &amp;amp;&amp;amp; mark &amp;gt;= 0 ) {
          this.marks.python = mark;
      } else {
          throw new Error("Please enter python mark between 0 to 100")
      }
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, whenever user try to set python marks greater than 100 or lower than 0 it will throw error&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set"&gt;Click here&lt;/a&gt; to read more about Setter&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Closure in JavaScript</title>
      <dc:creator>Rakesh Patel</dc:creator>
      <pubDate>Tue, 04 Jan 2022 09:30:50 +0000</pubDate>
      <link>https://dev.to/rakesh_patel/closure-in-javascript-5gmc</link>
      <guid>https://dev.to/rakesh_patel/closure-in-javascript-5gmc</guid>
      <description>&lt;p&gt;Most of us, as soon as they read/hear the name of &lt;strong&gt;closure&lt;/strong&gt;. either immediately skip the topic or find it very difficult to understand the concept. In this post I will try my best to simplify the concept of closure.&lt;/p&gt;

&lt;p&gt;before coming to definition, look at the below code snippets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0y0iqhitfuvwd3shum9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0y0iqhitfuvwd3shum9u.png" alt="Closure demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the above code is executed, then first &lt;code&gt;outerFunc()&lt;/code&gt; get into callstack. &lt;code&gt;outerFunc()&lt;/code&gt; will return &lt;code&gt;innerFunc()&lt;/code&gt; and &lt;code&gt;outerFunc()&lt;/code&gt; is pop out from callstack means all variables present inside &lt;code&gt;outerFunc()&lt;/code&gt; is get garbage collected. but if now we call &lt;code&gt;innerFunc()&lt;/code&gt; a.k.a &lt;code&gt;closureDemo()&lt;/code&gt; it will print value of outerVar (which is member of outerFunc()). when running above code, you will see below output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Outer Variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But how it's possible? &lt;code&gt;outerVar&lt;/code&gt; which is defined inside &lt;code&gt;outerFunc()&lt;/code&gt;. and now  &lt;code&gt;outerFunc()&lt;/code&gt; is no longer available in callstack. but still &lt;code&gt;innerFunc()&lt;/code&gt; have access to variable &lt;code&gt;outerVar&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;outerVar is declared with &lt;strong&gt;let&lt;/strong&gt; and we know let variable are function scoped.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, here comes the concept of closure. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The closure is a function that closes over ( a.k.a. capture, remembers) the variables from it's lexical scope.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;so even after executing function from anywhere (even outside of it's lexical scope) it remembers the variables/function from the place where it's defined.&lt;/p&gt;

&lt;p&gt;In above code, add the below line in last&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.dir(clouserDemo);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after running the code, you will see below output in console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsagkqahvs13k3em7dptl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsagkqahvs13k3em7dptl.png" alt="closure demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If any variables/function from their lexical scope is referenced inside inner function. then only closure is created else closure will not created&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Closure function will remember variable reference not value.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8o49yl6gm6nqjp31u49y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8o49yl6gm6nqjp31u49y.png" alt="Closure demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if we run above code it log &lt;code&gt;Changed Value&lt;/code&gt; in console&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I am newbie in writing technical content, So may be this post will not clear your closure concepts. For more detailed explanation &amp;amp; information about closure, I would suggest you to please go through the articles mentioned in References&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dmitripavlutin.com/simple-explanation-of-javascript-closures/" rel="noopener noreferrer"&gt;https://dmitripavlutin.com/simple-explanation-of-javascript-closures/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/scope-closures/ch7.md#you-dont-know-js-yet-scope--closures---2nd-edition" rel="noopener noreferrer"&gt;https://github.com/getify/You-Dont-Know-JS/blob/2nd-ed/scope-closures/ch7.md#you-dont-know-js-yet-scope--closures---2nd-edition&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=qikxEIxsXco&amp;amp;t=1197s" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=qikxEIxsXco&amp;amp;t=1197s&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>JavaScript &amp; Web API</title>
      <dc:creator>Rakesh Patel</dc:creator>
      <pubDate>Thu, 09 Dec 2021 10:58:53 +0000</pubDate>
      <link>https://dev.to/rakesh_patel/javascript-web-api-4j92</link>
      <guid>https://dev.to/rakesh_patel/javascript-web-api-4j92</guid>
      <description>&lt;p&gt;As we all know, API stands for Application Programming Interface. API is actually some kind of interface which is having a set of functions. These set of functions will allow programmers to acquire some specific features or the data of an application.&lt;br&gt;
Our web browser ( Chrome, Mozilla, Safari, etc. ) also provide some API, which is used by JavaScript engine. &lt;/p&gt;

&lt;blockquote&gt;
&lt;h6&gt;
  
  
  Note that these API's are not the part of JavaScript language.
&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;Below are the some most commonly used Web API's,&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Timer API ( setTimeout, setInterval)
&lt;/h4&gt;

&lt;h6&gt;
  
  
  These API are used for executing task after specific time duration.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/setTimeout"&gt;click here&lt;/a&gt; to read more...&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Console API
&lt;/h4&gt;

&lt;h6&gt;
  
  
  Yes, console is not the part of JavaScript language but it's browser API. We can access many console features like &lt;code&gt;console.log&lt;/code&gt;, &lt;code&gt;console.error&lt;/code&gt;, &lt;code&gt;console.dir&lt;/code&gt;, etc through this API.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/console"&gt;click here&lt;/a&gt; to read more...&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Document Object Model (DOM) API
&lt;/h4&gt;

&lt;h6&gt;
  
  
  DOM API are used to access, modify web document i.e. HTML pages. some commonly used DOM  properties are &lt;code&gt;document.getElementById&lt;/code&gt;, &lt;code&gt;document.append&lt;/code&gt;, etc.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model"&gt;click here&lt;/a&gt; to read more...&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Storage API ( localStorage, sessionStorage)
&lt;/h4&gt;

&lt;h6&gt;
  
  
  Storage API's are used for storing data locally in client side.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"&gt;click here&lt;/a&gt; to read more...&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Geolocation API ( Navigatior)
&lt;/h4&gt;

&lt;h6&gt;
  
  
  To get user's location related information , this API is used.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API"&gt;click here&lt;/a&gt; to read more...&lt;/p&gt;

&lt;p&gt;There are many Web API's are available. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API"&gt;click here&lt;/a&gt; to read more about all of API's&lt;/p&gt;

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