<?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: Agboola Quadri yomike</title>
    <description>The latest articles on DEV Community by Agboola Quadri yomike (@yomtech).</description>
    <link>https://dev.to/yomtech</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%2F1519205%2F3837a4ed-04f3-4930-b1b1-aa21345e8fde.jpg</url>
      <title>DEV Community: Agboola Quadri yomike</title>
      <link>https://dev.to/yomtech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yomtech"/>
    <language>en</language>
    <item>
      <title>swapping in js</title>
      <dc:creator>Agboola Quadri yomike</dc:creator>
      <pubDate>Thu, 06 Jun 2024 08:53:03 +0000</pubDate>
      <link>https://dev.to/yomtech/swapping-in-js-1agg</link>
      <guid>https://dev.to/yomtech/swapping-in-js-1agg</guid>
      <description>&lt;p&gt;Swapping two variables with one another is an extremely easy task.&lt;/p&gt;

&lt;p&gt;We need a temporary variable to hold the value of one variable (let's say a) while we update that variable (a) to the other variable (b, in this case).&lt;/p&gt;

&lt;p&gt;Once the first variable (a) is updated to the second variable (b), the second variable is updated to the temporary variable.&lt;/p&gt;

&lt;p&gt;In the code below, we create this temporary variable temp, and complete the swapping of a and b:&lt;/p&gt;

&lt;p&gt;var a = 10;&lt;br&gt;
var b = 20;&lt;/p&gt;

&lt;p&gt;// Swap a and b&lt;br&gt;
var temp = a;&lt;br&gt;
a = b;&lt;br&gt;
b = temp;&lt;br&gt;
Let's inspect the values of a and b:&lt;/p&gt;

&lt;p&gt;a == 20&lt;br&gt;
b == 10&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ydtrtbjjb3luij6uvl8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ydtrtbjjb3luij6uvl8.png" alt="Image description" width="526" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript Class Constructors</title>
      <dc:creator>Agboola Quadri yomike</dc:creator>
      <pubDate>Mon, 03 Jun 2024 17:28:57 +0000</pubDate>
      <link>https://dev.to/yomtech/javascript-class-constructors-ice</link>
      <guid>https://dev.to/yomtech/javascript-class-constructors-ice</guid>
      <description>&lt;p&gt;In JavaScript, a class constructor is a special method in a class that is called when an object is created from the class. It is used to initialize the object's properties and set the initial state of the object.&lt;/p&gt;

&lt;p&gt;Here is an example of a simple class constructor in JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;Person&lt;/code&gt; class has a constructor that takes two arguments, &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt;. When a new &lt;code&gt;Person&lt;/code&gt; object is created, the constructor is called, and the &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt; properties are set.&lt;/p&gt;

&lt;p&gt;For examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let person = new Person('John', 30);
console.log(person.name); // Output: John
console.log(person.age); // Output: 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here are some key points about class constructors in JavaScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The constructor is called when an object is created from the class using the &lt;code&gt;new&lt;/code&gt; keyword.&lt;/li&gt;
&lt;li&gt;The constructor is responsible for initializing the object's properties.&lt;/li&gt;
&lt;li&gt;The constructor can take arguments, which are passed when the object is created.&lt;/li&gt;
&lt;li&gt;If no constructor is defined, a default constructor is created automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some more examples of class constructors in JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car {
  constructor(make, model, year) {
    this.make = make;
    this.model = model;
    this.year = year;
  }
}

let car = new Car('Toyota', 'Corolla', 2020);

class Point {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }
}

let point = new Point(10, 20);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Difference between Synchronous % Asynchronous</title>
      <dc:creator>Agboola Quadri yomike</dc:creator>
      <pubDate>Fri, 31 May 2024 13:50:19 +0000</pubDate>
      <link>https://dev.to/yomtech/different-between-synchronous-asynchronous-4p4</link>
      <guid>https://dev.to/yomtech/different-between-synchronous-asynchronous-4p4</guid>
      <description>&lt;p&gt;How code is executed in JavaScript falls into two main categories: synchronous and asynchronous. Understanding these two is key to writing efficient and responsive web applications.&lt;/p&gt;

&lt;p&gt;Synchronous&lt;/p&gt;

&lt;p&gt;Synchronous code execution happens sequentially, one line at a time. Each line of code waits for the previous line to finish before it starts. Imagine it like waiting in line at a store - you can't move forward until the person in front of you does.&lt;/p&gt;

&lt;p&gt;Here's an example of synchronous code:&lt;/p&gt;

&lt;p&gt;console.log("I'm first!");&lt;/p&gt;

&lt;p&gt;let result = someFunctionThatTakesTime(); // Simulates a long-running task&lt;br&gt;
console.log(result);&lt;br&gt;
In this example, the first line "I'm first!" will be logged to the console, then the program will pause and wait for someFunctionThatTakesTime to finish. Once it does, the result will be logged.&lt;/p&gt;

&lt;p&gt;Asynchronous&lt;/p&gt;

&lt;p&gt;Asynchronous code execution, on the other hand, doesn't block the main thread. When an asynchronous operation is encountered, like fetching data from a server, the program continues to execute the next line of code. The asynchronous operation runs in the background, and when it's finished, it notifies the program through a callback function.&lt;/p&gt;

&lt;p&gt;Here's an example of asynchronous code:&lt;/p&gt;

&lt;p&gt;console.log("I'm first!");&lt;/p&gt;

&lt;p&gt;fetchDataFromServer(function(data) {&lt;br&gt;
  console.log(data);&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;console.log("I'm third!"); // This will be executed before data is fetched&lt;/p&gt;

&lt;p&gt;In this example, all three lines are executed one after another. However, the fetchDataFromServer function is asynchronous. So, "I'm first!" and "I'm third!" will be logged immediately, and then the program will continue to wait for the data to be fetched. Once the data is retrieved, the callback function will be executed, and the data will be logged.&lt;/p&gt;

&lt;p&gt;Why Asynchronous is Important&lt;/p&gt;

&lt;p&gt;Asynchronous programming is essential for creating responsive web applications. If long-running tasks constantly block your code, your UI will become unresponsive and users will have a bad experience. Using asynchronous techniques, you can keep your UI responsive while background tasks are completed.&lt;/p&gt;

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