<?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: Adel Emad</title>
    <description>The latest articles on DEV Community by Adel Emad (@mrottimista).</description>
    <link>https://dev.to/mrottimista</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%2F571737%2F93fc0a5f-6524-4acf-9f53-3073c117a046.jpeg</url>
      <title>DEV Community: Adel Emad</title>
      <link>https://dev.to/mrottimista</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrottimista"/>
    <language>en</language>
    <item>
      <title>Progressive web app (PWA) Mistakes and Enhancements</title>
      <dc:creator>Adel Emad</dc:creator>
      <pubDate>Sat, 05 Feb 2022 18:44:43 +0000</pubDate>
      <link>https://dev.to/mrottimista/things-that-you-do-not-know-about-your-pwa-mainfest-ob0</link>
      <guid>https://dev.to/mrottimista/things-that-you-do-not-know-about-your-pwa-mainfest-ob0</guid>
      <description>&lt;p&gt;In this article, we will show some mistakes that developers do in their PWA manifests and some tips to enhance your PWA through enhancing your manifest. &lt;/p&gt;

&lt;p&gt;Before I start, let's have a moment to explain some important definitions.&lt;/p&gt;




&lt;h3&gt;
  
  
  Definitions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;PWA&lt;/strong&gt; (Progressive Web App): according to &lt;a href="https://web.dev/what-are-pwas/" rel="noopener noreferrer"&gt;web.dev&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Progressive Web Apps are web applications that have been designed so they are capable, reliable, and installable. These three pillars transform them into an experience that feels like a platform-specific application.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, PWA seems like a native app for mobile and desktop platforms but it runs in browsers capabilities. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manifest&lt;/strong&gt;: is the backbone for your PWA. It is a JSON file that includes some basic info and some necessary resources for your app. &lt;/p&gt;

&lt;p&gt;After understanding these definitions,  we are ready to start our article. &lt;/p&gt;




&lt;h2&gt;
  
  
  Mistakes most developers do in their manifests:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Icons property&lt;/strong&gt;: In your manifest, you can set a list of your app icon so when the user installs your app, he/she can see the app icon in the os launcher as any native app. &lt;strong&gt;However&lt;/strong&gt;, this property does not work in IOS devices 😱&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How to solve this issue ?&lt;/strong&gt; &lt;br&gt;
you can define the icons on your html &lt;code&gt;head&lt;/code&gt; like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"apple-touch-icon"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"180x180"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"yourIcon.png"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Display property&lt;/strong&gt;: you can set how your app will look like when it is open through using this property. It can have a value from &lt;code&gt;fullscreen&lt;/code&gt;, &lt;code&gt;standalone&lt;/code&gt; &lt;code&gt;minimal-ui&lt;/code&gt; or &lt;code&gt;browser&lt;/code&gt;. &lt;strong&gt;However&lt;/strong&gt;, Some developers forget about the notch when they set &lt;code&gt;fullscreen&lt;/code&gt; value so the content is trimmed from above and their app appears like this&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%2Fxfoft0a7d1tl6zcigklm.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%2Fxfoft0a7d1tl6zcigklm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt;&lt;br&gt;
You can use &lt;a href="https://reactnative.dev/docs/safeareaview#:~:text=The%20purpose%20of,on%20iPhone%2013" rel="noopener noreferrer"&gt;SafeAreaView&lt;/a&gt; and  set some padding to your app through CSS.  like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="nt"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;env&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;safe-area-inset-top&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt; &lt;span class="nt"&gt;env&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;safe-area-inset-left&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but first, you need to take the permission to use these values. &lt;br&gt;
So in your head tag, you should place these tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"initial-scale=1, viewport-fit=cover, width=device-width"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/meta&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"apple-mobile-web-app-capable"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"yes"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/meta&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"apple-mobile-web-app-status-bar-style"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"black-translucent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/meta&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://i.giphy.com/media/6j9Bqkv3r4NjcAIppe/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/6j9Bqkv3r4NjcAIppe/giphy.gif" alt="Alt Text"&gt;&lt;/a&gt; &lt;/p&gt;




&lt;h2&gt;
  
  
  How to enhance your manifest?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;short-name property:&lt;/strong&gt; In your manifest, you can set a &lt;code&gt;name&lt;/code&gt; for your PWA but what if the OS does not have enough space to display the name? 
yes, you guess it right, the &lt;code&gt;short-name&lt;/code&gt; will be displayed. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What will happen if I don't set the &lt;code&gt;short-name&lt;/code&gt; prop? &lt;br&gt;
if your app name is long, it will be trimmed like this 👇 &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%2Fsp4k6s1ibw3rlvtoacig.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%2Fsp4k6s1ibw3rlvtoacig.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add screenshots to your app installation:&lt;/strong&gt;  When you prompt a modal to ask the user to install your PWA using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent" rel="noopener noreferrer"&gt;beforeInstallPrompt&lt;/a&gt; event, You can add some screenshots from your app to attract the user to install it. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;it will look like this &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%2Fu665whueq5qen798us3h.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%2Fu665whueq5qen798us3h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and here is a snapshot from the Twitter manifest.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"screenshots"&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"https://abs.twimg.com/responsive-web/client-web/twitter-lite-data-saver-marketing.68059865.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"586x1041"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"https://abs.twimg.com/responsive-web/client-web/twitter-lite-explore-marketing.fd45b025.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"586x1041"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, you should consider manifest props limitations and consider enhancing user experience to attract him/her to install your app&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%2Fopyr49u6a6jx3hwzj61k.gif" 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%2Fopyr49u6a6jx3hwzj61k.gif"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>design</category>
      <category>pwa</category>
    </item>
    <item>
      <title>Do you know these data-types in JavaScript  </title>
      <dc:creator>Adel Emad</dc:creator>
      <pubDate>Wed, 28 Jul 2021 05:54:16 +0000</pubDate>
      <link>https://dev.to/mrottimista/do-you-know-these-data-types-in-js-4i05</link>
      <guid>https://dev.to/mrottimista/do-you-know-these-data-types-in-js-4i05</guid>
      <description>&lt;p&gt;Besides all the known data types in javascript like Stings, Arrays, and Objects, there are some other types that are not widely used. &lt;/p&gt;

&lt;p&gt;In this article, I will explain Two data types in JS &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maps&lt;/li&gt;
&lt;li&gt;Sets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Maps
&lt;/h2&gt;

&lt;p&gt;Maps are collections of key-value items, and yes this is similar to Objects. &lt;br&gt;
However, there are some differences that make the &lt;strong&gt;Maps&lt;/strong&gt; data type unique 😎 .&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Objects Keys&lt;/strong&gt; are always one of type &lt;code&gt;String or Symbol&lt;/code&gt;, you can not have a key in an object with any other type&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maps Keys&lt;/strong&gt; can be any type of data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's see some examples for object keys&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6QdnOf_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p04z03lnrcrvtrm2srfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6QdnOf_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p04z03lnrcrvtrm2srfp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see in the above example, objects keys are converted to type string even if they are &lt;strong&gt;not strings&lt;/strong&gt;&lt;br&gt;
so the keys are converted like this &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;1&lt;/code&gt; will be &lt;code&gt;'1'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'string'&lt;/code&gt; will be &lt;code&gt;'string'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{'key':'value'}&lt;/code&gt; will be &lt;code&gt;[object Object]&lt;/code&gt; which is the  output from conversion of object to a string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's see how the Maps types handle this issue &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vSxv61-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mzzeq7t9zbp5316ijds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vSxv61-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mzzeq7t9zbp5316ijds.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;as we can see the keys of the Map remain the same without any conversion in type.&lt;/p&gt;

&lt;p&gt;In the below table, there is a comparison between Map and Object&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Maps&lt;/th&gt;
&lt;th&gt;Objects&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Keys&lt;/td&gt;
&lt;td&gt;Can be any data type&lt;/td&gt;
&lt;td&gt;Any key should be of type string or symbol&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Define&lt;/td&gt;
&lt;td&gt;&lt;code&gt;let map = new Map();&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;let obj = {}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Set pair (key-value)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;map.set(key,value)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;obj[key] = value&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;get value of key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;map.get(key)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;obj[key]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;remove value by key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;map.delete(key)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;obj[key]=undefined&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;get keys&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;map.keys()&lt;/code&gt; &lt;br&gt;returns an iterable for keys&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Object.keys(obj)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;check if has key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;map.has(key)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;obj.hasOwnProperty(key)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Sets
&lt;/h2&gt;

&lt;p&gt;Sets is another data type in JS, it is a collection of values where each value occur only once.&lt;/p&gt;

&lt;p&gt;Let's see an example &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YfThA4Qx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfs3xy5lz9u88spcirzg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YfThA4Qx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfs3xy5lz9u88spcirzg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An interesting application for this is to remove the duplicate values from array. For example&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tu3XJ7wU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lwtiz33hf2gt4xgwvsvm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tu3XJ7wU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lwtiz33hf2gt4xgwvsvm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can know more about Maps and Sets from &lt;a href="https://javascript.info/map-set"&gt;here&lt;/a&gt;  🌻&lt;/p&gt;

&lt;p&gt;Finally, it is great to know more about all the types of Javascript as you can need them in the future.&lt;br&gt;
even if you rarely use them, having the knowledge of these types will expand your ability to have different solutions for some problems 🎉     &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>node</category>
    </item>
    <item>
      <title>Git Bisect, When and How?</title>
      <dc:creator>Adel Emad</dc:creator>
      <pubDate>Mon, 26 Apr 2021 21:00:25 +0000</pubDate>
      <link>https://dev.to/mrottimista/git-bisect-when-and-how-5847</link>
      <guid>https://dev.to/mrottimista/git-bisect-when-and-how-5847</guid>
      <description>&lt;p&gt;In this article, we will learn about the &lt;code&gt;git bisect&lt;/code&gt; command which is rarely used but can be helpful in some cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  When can we use &lt;code&gt;git bisect&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;according to &lt;a href="https://git-scm.com/docs/git-bisect"&gt;git docs&lt;/a&gt;, &lt;code&gt;git bisect&lt;/code&gt; is used to find a commit that produces a &lt;strong&gt;bug&lt;/strong&gt; ; however, I do say that it can be used to find a commit that produces &lt;strong&gt;anything&lt;/strong&gt; you can notice in the program output; for example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log statement (ex. console.log)&lt;/li&gt;
&lt;li&gt;Enhancement to a certain part ..etc &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, if you are asking where I can find the commit that is responsible for certain output, you can use &lt;code&gt;git bisect&lt;/code&gt; command&lt;/p&gt;

&lt;h2&gt;
  
  
  When not to use it?
&lt;/h2&gt;

&lt;p&gt;If you want to know the commit or person that is responsible for a certain part of the code, you can use &lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"&gt;Gitlens&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Use &lt;code&gt;git bisect&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;Do not use &lt;code&gt;git bisect&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;You want&lt;/td&gt;
&lt;td&gt;To get the commit and its info&lt;/td&gt;
&lt;td&gt;To get the commit and its info&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You have&lt;/td&gt;
&lt;td&gt;Output not code.. for example:&lt;br&gt;  - Bug you can reproduce&lt;br&gt;  - log statement&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Code&lt;/strong&gt; so you can use another tool to get the commit info&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How can I use &lt;code&gt;git bisect&lt;/code&gt; 🤔?
&lt;/h2&gt;

&lt;p&gt;First, detect the &lt;em&gt;output&lt;/em&gt; that you are searching for its commit info, then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git bisect start  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git bisect good [hash of commit]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and insert the hash of the commit where you are sure that that certain &lt;em&gt;output&lt;/em&gt; is not present.&lt;br&gt;
Then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git bisect bad [hash of commit]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where you are sure you can reproduce this certain &lt;em&gt;output&lt;/em&gt;. you can leave it empty to choose the certain commit.&lt;/p&gt;

&lt;p&gt;then git will start jumping between commits that are between the &lt;strong&gt;good commit&lt;/strong&gt; and the &lt;strong&gt;bad commit&lt;/strong&gt; &lt;br&gt;
for every commit, try to reproduce the &lt;em&gt;output&lt;/em&gt; that you target, if you can reproduce it, then run &lt;code&gt;git bisect bad&lt;/code&gt;; &lt;br&gt;
if you can not reproduce it, run &lt;code&gt;git bisect good&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, git will log the commit info that is responsible for the output that you are looking for 🎉. &lt;br&gt;
Then run &lt;code&gt;git bisect reset&lt;/code&gt; to end the process.&lt;/p&gt;

&lt;p&gt;I hope this article has helped you understand &lt;code&gt;git bisect&lt;/code&gt; command&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
