<?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: Sadiq Shah</title>
    <description>The latest articles on DEV Community by Sadiq Shah (@sadiqshah786).</description>
    <link>https://dev.to/sadiqshah786</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%2F865153%2F7b4cec98-71c7-4cec-89a0-cf910f9b543a.jpeg</url>
      <title>DEV Community: Sadiq Shah</title>
      <link>https://dev.to/sadiqshah786</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sadiqshah786"/>
    <language>en</language>
    <item>
      <title>Find your Location With Javascript</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Tue, 05 Nov 2024 05:57:40 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/find-your-location-with-javascript-1lok</link>
      <guid>https://dev.to/sadiqshah786/find-your-location-with-javascript-1lok</guid>
      <description>&lt;p&gt;In this blog post, we demonstrate how to retrieve the current location from the browser, then use the longitude and latitude coordinates to determine the exact location. We’ll use a free API from Maps.co to perform reverse geocoding, which converts coordinates into a human-readable&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Implement:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Get Current Location: We access the user’s current location, which the browser provides (with user permission). This will give us the latitude and longitude values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reverse Geocode API: With these coordinates, we make an API call to Maps.co’s Reverse Geocoding API to get the full address. You can get an API key for free by signing up on their platform.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;API Endpoint: The endpoint for reverse geocoding is:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://geocode.maps.co/reverse?lat=latitude&amp;amp;lon=longitude&amp;amp;api_key=YOUR_API_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace latitude and longitude with the actual values, and YOUR_API_KEY with your personal API key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`const api_key = "you key";

const currentLocation = () =&amp;gt; {
    navigator.geolocation.getCurrentPosition((position) =&amp;gt; {
        fetchLocation(position.coords.longitude, position.coords.latitude)
    }, (error) =&amp;gt; {
         console.error("Current Location", error);
    })

}
const fetchLocation = async (lon, lat) =&amp;gt; {
    try {
           const location = await fetch(`https://geocode.maps.co/reverse?lat=${lat}&amp;amp;lon=${lon}&amp;amp;api_key=${api_key}`)
     const response = await location.json();
     console.log(response?.display_name);
    }
    catch (error) {
         console.error("Error fetching location:", error);
    }

}

currentLocation();`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>api</category>
      <category>nextjs</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How JavaScript Works?</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Wed, 04 Jan 2023 07:39:09 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/how-javascript-works-4pjk</link>
      <guid>https://dev.to/sadiqshah786/how-javascript-works-4pjk</guid>
      <description>&lt;p&gt;Working on the JavaScript is good but should also know the execution of the JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fp3rwn91kotcwbdqnmqoo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fp3rwn91kotcwbdqnmqoo.gif" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let discussed How JavaScript works?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript works on browser with the help of execution context
means the execution context is the box where your all java scripts are render. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But there are two components&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory Component (Variable Environment) &lt;/li&gt;
&lt;li&gt;Code Component   (Thread of Execution) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;memory and code are linked together because code are stored into memory then execute.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Memory Component:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It is stored all variable and function as key paired value.&lt;br&gt;
Example:&lt;br&gt;
 {&lt;br&gt;
     a = "sadiq"&lt;br&gt;
     function : sum(n,a)&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Code Component:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In code component your all code render line by line or run 1 line at a time and also know as thread of execution.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;JavaScript is synchronous single threading language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Single Threading :&lt;/strong&gt; Run one line of code at a time.&lt;br&gt;
&lt;strong&gt;Synchronous Single Threading :&lt;/strong&gt; Run one line of code at a time with &lt;/p&gt;

&lt;p&gt;That Why JavaScript know as Synchronous Scripting Language .&lt;br&gt;
specific order. &lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>JavaScript Events</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Tue, 15 Nov 2022 08:15:18 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/javascript-events-22hn</link>
      <guid>https://dev.to/sadiqshah786/javascript-events-22hn</guid>
      <description>&lt;h2&gt;
  
  
  JavaScript Events:
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;An event is a signal that something happened.&lt;/em&gt;&lt;br&gt;
All DOM generated signals.&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of Events
&lt;/h1&gt;

&lt;p&gt;There are many Events in JavaScript but some events discuss in this article.&lt;/p&gt;

&lt;h3&gt;
  
  
  - Mouse Events
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click : Its performed when mouse click on any element.
       and touchscreen user can tabs to perform this event.&lt;/li&gt;
&lt;li&gt;contextmenu :  Its performed when mouse  right click on any element.&lt;/li&gt;
&lt;li&gt;mouseover : Its performed when mouseover the element.&lt;/li&gt;
&lt;li&gt;mouseout :  Its performed when mouseout the element.&lt;/li&gt;
&lt;li&gt;mouseup : Its performed when mouse pressed.&lt;/li&gt;
&lt;li&gt;mousedown: Its performed when mouse released over an element.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  - Keyboard Events
&lt;/h3&gt;

&lt;p&gt;1.keydown and keyup – when a keyboard key is pressed and released.&lt;/p&gt;

&lt;h3&gt;
  
  
  - Form Element Events
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;submit:  when the visitor submits a &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;focus:  when the visitor focuses on an element, e.g. on an &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  - Document Events:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;DOMContentLoaded: when the HTML is loaded and processed, DOM is fully built.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  - CSS events:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;transitionend:  when a CSS-animation finishes.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Introduction to JavaScript</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Sun, 23 Oct 2022 05:48:39 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/introduction-to-javascript-1ahe</link>
      <guid>https://dev.to/sadiqshah786/introduction-to-javascript-1ahe</guid>
      <description>&lt;h2&gt;
  
  
  What is JavaScript ?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;JavaScript was initially created to “make web pages alive”.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--svcEW9UR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wha678idm26ivjc5k54o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--svcEW9UR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wha678idm26ivjc5k54o.PNG" alt="Image description" width="647" height="405"&gt;&lt;/a&gt;&lt;br&gt;
JavaScript is Scripting language and programs write in this language called as Script.&lt;/p&gt;

&lt;p&gt;Scripts are provided and executed as plain text. They don’t need special preparation or compilation to run.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>script</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is Variable? How to declare? and Legal and Illegal variables declaration in JavaScript?</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Sun, 22 May 2022 14:13:07 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/what-is-variable-how-to-declare-and-legal-and-illegal-variables-declaration-in-javascript-4g9k</link>
      <guid>https://dev.to/sadiqshah786/what-is-variable-how-to-declare-and-legal-and-illegal-variables-declaration-in-javascript-4g9k</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;What is variable ?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Variables is the placeholder or the box, container that contains the values i.e. Letter(Strings), Number(integers, decimal), Characters(Special Symbol), Boolean(true and false), Object etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data type :
&lt;/h2&gt;

&lt;p&gt;Data type which defines the variable type or what kind of value can be store in the variable.(integer, string, number, symbol, Boolean, Object etc.)  &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How you can declare the variable in JavaScript&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;keyword specifier/Identifier   = value (Data type)&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example :&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name = "Sadiq Shah";
var age = 23;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(I pass the value string to the variable named as name and age into number)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Legal and Illegal variable in JS?&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Legal Variables : Can be declare
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var myname = "Sadiq Shah";
    var myName = "Sadiq Shah";
    var my_name = "sadiq shah";
    var _my_name = "sadiq shah";
    var $my_name = "sadiq shah";

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Illegal Variables : Can not be declare
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var @myname = "Sadiq Shah";
    var 123myName = "Sadiq Shah";
    var my name = "sadiq shah";
    var month&amp;amp;year = "saadiq shah";
    var birth-year = "1990";

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is ECMA and what is the latest version of it ?</title>
      <dc:creator>Sadiq Shah</dc:creator>
      <pubDate>Sat, 21 May 2022 15:49:34 +0000</pubDate>
      <link>https://dev.to/sadiqshah786/what-is-ecma-and-what-is-the-latest-version-of-it--4c2p</link>
      <guid>https://dev.to/sadiqshah786/what-is-ecma-and-what-is-the-latest-version-of-it--4c2p</guid>
      <description>&lt;p&gt;ECMA International is a nonprofit standards organization for information and communication systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript introduce 1996&lt;/strong&gt; &lt;br&gt;
ECMA Script: when JavaScript introduce into the ECMA International Company then It’s called by ECMA + Script and introduce by 1997&lt;/p&gt;

&lt;h2&gt;
  
  
  Version of ECMA Script :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;ECMA-262 5.1 edition, June 2011.&lt;/li&gt;
&lt;li&gt;ECMA-262, 6th edition, June 2015.&lt;/li&gt;
&lt;li&gt;ECMA-262, 7th edition, June 2016.&lt;/li&gt;
&lt;li&gt;ECMA-262, 8th edition, June 2017.&lt;/li&gt;
&lt;li&gt;ECMA-262, 9th edition, June 2018.&lt;/li&gt;
&lt;li&gt;ECMA-262, 10th edition, June 2019.&lt;/li&gt;
&lt;li&gt;ECMA-262, 11th edition, June 2020.&lt;/li&gt;
&lt;/ul&gt;

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