<?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: diego michel</title>
    <description>The latest articles on DEV Community by diego michel (@digomic).</description>
    <link>https://dev.to/digomic</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%2F586560%2Fd40afa60-f351-4cc8-8ae8-48a6390c8ca0.png</url>
      <title>DEV Community: diego michel</title>
      <link>https://dev.to/digomic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/digomic"/>
    <language>en</language>
    <item>
      <title>async and await in javascript</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Mon, 13 Jun 2022 04:19:45 +0000</pubDate>
      <link>https://dev.to/digomic/async-and-await-in-javascript-2bc4</link>
      <guid>https://dev.to/digomic/async-and-await-in-javascript-2bc4</guid>
      <description>&lt;p&gt;ES2017 introduces two new keywords—async and await—that represent a paradigm shift in asynchronous JavaScript programming. These new keywords dramatically simplify the use of Promises and allow us to write Promise-based, asynchronous code that looks like synchronous code that blocks while waiting for network responses or other asynchronous events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;await Expressions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The await keyword takes a Promise and turns it back into a return value or a thrown exception. Given a Promise object p, the expression await p waits until p settles. If p fulfills, then the value of await p is the fulfillment value of p. On the other hand, if p is rejected, then the await p expression throws the rejection value of p. We don’t usually use await with a variable that holds a Promise; instead, we use it before the invocation of a function that returns a Promise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let response = await fetch("/api/user/profile");
let profile = await response.json();

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;async Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because any code that uses await is asynchronous, there is one critical rule: you can only use the await keyword within functions that have been declared with the async keyword.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getHighScore() {
    let response = await fetch("/api/user/profile");
    let profile = await response.json();
    return profile.highScore;
}

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

&lt;/div&gt;



&lt;p&gt;Declaring a function async means that the return value of the function will be a Promise even if no Promise-related code appears in the body of the function. If an async function appears to return normally, then the Promise object that is the real return value of the function will resolve to that apparent return value. And if an async function appears to throw an exception, then the Promise object that it returns will be rejected with that exception.&lt;/p&gt;

&lt;p&gt;The getHighScore() function is declared async, so it returns a Promise. And because it returns a Promise, we can use the await keyword with it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;displayHighScore(await getHighScore());

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Awaiting Multiple Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose that we’ve written our getJSON() function using async.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getJSON(url) {
    let response = await fetch(url);
    let body = await response.json();
    return body;
}

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

&lt;/div&gt;



&lt;p&gt;And now suppose that we want to fetch two JSON values with this 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 value1 = await getJSON(url1);
let value2 = await getJSON(url2);

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

&lt;/div&gt;



&lt;p&gt;The problem with this code is that it is unnecessarily sequential: the fetch of the second URL will not begin until the first fetch is complete. If the second URL does not depend on the value obtained from the first URL, then we should probably try to fetch the two values at the same time. This is a case where the Promise-based nature of async functions shows. In order to await a set of concurrently executing async functions, we use Promise.all() just as we would if working with Promises directly&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let [value1, value2] = await Promise.all([getJSON(url1), getJSON(url2)]);

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Promises in javascript</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Tue, 07 Jun 2022 16:16:02 +0000</pubDate>
      <link>https://dev.to/digomic/promises-in-javascript-39ck</link>
      <guid>https://dev.to/digomic/promises-in-javascript-39ck</guid>
      <description>&lt;p&gt;A Promise is an object that represents the result of an asynchronous computation. That result may or may not be ready yet, and the Promise API is intentionally vague about this: there is no way to synchronously get the value of a Promise; you can only ask the Promise to call a callback function when the value is ready.&lt;/p&gt;

&lt;p&gt;Promises are just a different way of working with callbacks. However, there are practical benefits to using them. One real problem with callback-based asynchronous programming is that it is common to end up with callbacks inside callbacks inside callbacks, with lines of code so highly indented that it is difficult to read.&lt;/p&gt;

&lt;p&gt;Another problem with callbacks is that they can make handling errors difficult. If an asynchronous function throws an exception, there is no way for that exception to propagate back to the initiator of the asynchronous operation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the advent of Promises in the core JavaScript language, web browsers have begun to implement Promise-based APIs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getJSON(url).then(jsonData =&amp;gt; {
    // This is a callback function that will be asynchronously
    // invoked with the parsed JSON value when it becomes available.
});

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

&lt;/div&gt;



&lt;p&gt;getJSON() starts an asynchronous HTTP request for the URL you specify and then, while that request is pending, it returns a Promise object. The Promise object defines a then() instance method. Instead of passing our callback function directly to getJSON(), we instead pass it to the then() method. When the HTTP response arrives, the body of that response is parsed as JSON, and the resulting parsed value is passed to the function that we passed to then().&lt;/p&gt;

&lt;p&gt;You can think of the then() method as a callback registration method like the addEventListener() method used for registering event handlers in client-side JavaScript. If you call the then() method of a Promise object multiple times, each of the functions you specify will be called when the promised computation is complete.&lt;/p&gt;

&lt;p&gt;It is also idiomatic to name functions that return Promises and functions that use the results of Promises with verbs, and these idioms lead to code that is particularly easy to read.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Suppose you have a function like this to display a user profile
function displayUserProfile(profile) { /* implementation omitted */ }

// Here's how you might use that function with a Promise.
// Notice how this line of code reads almost like an English sentence:
getJSON("/api/user/profile").then(displayUserProfile);

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Handling errors with Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asynchronous operations, particularly those that involve networking, can typically fail in a number of ways, and robust code has to be written to handle the errors that will inevitably occur.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getJSON("/api/user/profile").then(displayUserProfile, handleProfileError);

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

&lt;/div&gt;



&lt;p&gt;A Promise represents the future result of an asynchronous computation that occurs after the Promise object is created. Because the computation is performed after the Promise object is returned to us, there is no way that the computation can traditionally return a value or throw an exception that we can catch&lt;/p&gt;

&lt;p&gt;The functions that we pass to then() provide alternatives. When a synchronous computation completes normally, it simply returns its result to its caller. When a Promise-based asynchronous computation completes normally, it passes its result to the function that is the first argument to then().&lt;/p&gt;

&lt;p&gt;In practice, it is rare to see two functions passed to then(). There is a better and more idiomatic way of handling errors when working with Promises. To understand it, first consider what happens if getJSON() completes normally but an error occurs in displayUserProfile(). That callback function is invoked asynchronously when getJSON() returns, so it is also asynchronous and cannot meaningfully throw an exception.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getJSON("/api/user/profile").then(displayUserProfile).catch(handleProfileError);

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

&lt;/div&gt;



&lt;p&gt;With this code, a normal result from getJSON() is still passed to displayUserProfile(), but any error in getJSON() or in displayUserProfile() (including any exceptions thrown by displayUserProfile) get passed to handleProfileError(). The catch() method is just a shorthand for calling then() with a null first argument and the specified error handler function as the second argument.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chaining Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most important benefits of Promises is that they provide a natural way to express a sequence of asynchronous operations as a linear chain of then() method invocations, without having to nest each operation within the callback of the previous one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch(documentURL)                      // Make an HTTP request
    .then(response =&amp;gt; response.json())  // Ask for the JSON body of the response
    .then(document =&amp;gt; {                 // When we get the parsed JSON
        return render(document);        // display the document to the user
    })
    .then(rendered =&amp;gt; {                 // When we get the rendered document
        cacheInDatabase(rendered);      // cache it in the local database.
    })
    .catch(error =&amp;gt; handle(error));     // Handle any errors that occur

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

&lt;/div&gt;



&lt;p&gt;This code illustrates how a chain of Promises can make it easy to express a sequence of asynchronous operations.&lt;/p&gt;

&lt;p&gt;That promise is fulfilled when the HTTP response begins to arrive and the HTTP status and headers are available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("/api/user/profile").then(response =&amp;gt; {
    // When the promise resolves, we have status and headers
    if (response.ok &amp;amp;&amp;amp;
        response.headers.get("Content-Type") === "application/json") {
        // What can we do here? We don't actually have the response body yet.
    }
});

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

&lt;/div&gt;



&lt;p&gt;When the Promise returned by fetch() is fulfilled, it passes a Response object to the function you passed to its then() method. This response object gives you access to request status and headers, and it also defines methods like text() and json(), which give you access to the body of the response in text and JSON-parsed forms, respectively. But although the initial Promise is fulfilled, the body of the response may not yet have arrived. So these text() and json() methods for accessing the body of the response themselves return Promises. Here’s a naive way of using fetch() and the response.json() method to get the body of an HTTP response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("/api/user/profile").then(response =&amp;gt; {
    response.json().then(profile =&amp;gt; {  // Ask for the JSON-parsed body
        // When the body of the response arrives, it will be automatically
        // parsed as JSON and passed to this function.
        displayUserProfile(profile);
    });
});

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

&lt;/div&gt;



&lt;p&gt;This is a naive way to use Promises because we nested them, like callbacks, which defeats the purpose. The preferred idiom is to use Promises in a sequential chain with code like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch("/api/user/profile")
    .then(response =&amp;gt; {
        return response.json();
    })
    .then(profile =&amp;gt; {
        displayUserProfile(profile);
    });

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Resolving Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While explaining the URL-fetching Promise chain with the list in the last section, we talked about promises 1, 2, and 3. But there is actually a fourth Promise object involved as well, and this brings us to our important discussion of what it means for a Promise to be “resolved.”&lt;/p&gt;

&lt;p&gt;Remember that fetch() returns a Promise object which, when fulfilled, passes a Response object to the callback function we register. This Response object has .text(), .json(), and other methods to request the body of the HTTP response in various forms. But since the body may not yet have arrived, these methods must return Promise objects.&lt;/p&gt;

&lt;p&gt;Let’s rewrite the URL-fetching code one more time in a verbose and nonidiomatic way that makes the callbacks and promises explicit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function c1(response) {               // callback 1
    let p4 = response.json();
    return p4;                        // returns promise 4
}

function c2(profile) {                // callback 2
    displayUserProfile(profile);
}

let p1 = fetch("/api/user/profile");  // promise 1, task 1
let p2 = p1.then(c1);                 // promise 2, task 2
let p3 = p2.then(c2);                 // promise 3, task 3

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Promises in Parallel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’ve spent a lot of time talking about Promise chains for sequentially running the asynchronous steps of a larger asynchronous operation. Sometimes, though, we want to execute a number of asynchronous operations in parallel. The function Promise.all() can do this. Promise.all() takes an array of Promise objects as its input and returns a Promise. The returned Promise will be rejected if any of the input Promises are rejected. Otherwise, it will be fulfilled with an array of the fulfillment values of each of the input Promises. So, for example, if you want to fetch the text content of multiple URLs, you could use code like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// We start with an array of URLs
const urls = [ /* zero or more URLs here */ ];
// And convert it to an array of Promise objects
promises = urls.map(url =&amp;gt; fetch(url).then(r =&amp;gt; r.text()));
// Now get a Promise to run all those Promises in parallel
Promise.all(promises)
    .then(bodies =&amp;gt; { /* do something with the array of strings */ })
    .catch(e =&amp;gt; console.error(e));

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

&lt;/div&gt;



&lt;p&gt;Promise.all() is slightly more flexible than described before. The input array can contain both Promise objects and non-Promise values. If an element of the array is not a Promise, it is treated as if it is the value of an already fulfilled Promise and is simply copied unchanged into the output array.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"&gt;promise resource&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/digomicortU"&gt;https://www.buymeacoffee.com/digomicortU&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Asynchronous Programming in javascript(Callbacks)</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Tue, 31 May 2022 17:01:15 +0000</pubDate>
      <link>https://dev.to/digomic/asynchronous-programming-in-javascriptcallbacks-2kkm</link>
      <guid>https://dev.to/digomic/asynchronous-programming-in-javascriptcallbacks-2kkm</guid>
      <description>&lt;p&gt;A callback is a function that you write and then pass to some other function. That other function then invokes your function when some condition is met or some event occurs. The invocation of the callback function you provide notifies you of the condition or event, and sometimes, the invocation will include function arguments that provide additional details.&lt;/p&gt;

&lt;p&gt;This is easier to understand with some concrete examples, and the subsections that follow demonstrate various forms of callback-based asynchronous programming using both client-side JavaScript and Node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the simplest kinds of asynchrony is when you want to run some code after a certain amount of time has elapsed, you can do this with the setTimeout() function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;setTimeout(checkForUpdates, 60000);

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

&lt;/div&gt;



&lt;p&gt;The first argument to setTimeout() is a function and the second is a time interval measured in milliseconds. In the preceding code, a hypothetical checkForUpdates() function will be called 60,000 milliseconds (1 minute) after the setTimeout() call.&lt;/p&gt;

&lt;p&gt;setTimeout() calls the specified callback function one time, passing no arguments, and then forgets about it. If you are writing a function that really does check for updates, you probably want it to run repeatedly. You can do this by using setInterval() instead of setTimeout():&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Call checkForUpdates in one minute and then again every minute after that
let updateIntervalId = setInterval(checkForUpdates, 60000);

// setInterval() returns a value that we can use to stop the repeated
// invocations by calling clearInterval(). (Similarly, setTimeout()
// returns a value that you can pass to clearTimeout())
function stopCheckingForUpdates() {
    clearInterval(updateIntervalId);
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Client-side JavaScript programs are almost universally event driven: rather than running some kind of predetermined computation, they typically wait for the user to do something and then respond to the user’s actions. The web browser generates an event when the user presses a key on the keyboard, moves the mouse, clicks a mouse button, or touches a touchscreen device. Event-driven JavaScript programs register callback functions for specified types of events in specified contexts, and the web browser invokes those functions whenever the specified events occur.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Ask the web browser to return an object representing the HTML
// &amp;lt;button&amp;gt; element that matches this CSS selector
let okay = document.querySelector('#confirmUpdateDialog button.okay');

// Now register a callback function to be invoked when the user
// clicks on that button.
okay.addEventListener('click', applyUpdate);

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

&lt;/div&gt;



&lt;p&gt;applyUpdate() is a hypothetical callback function that we assume is implemented somewhere else. The call to document.querySelector() returns an object that represents a single specified element in the web page. We call addEventListener() on that element to register our callback.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network Events&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another common source of asynchrony in JavaScript programming is network requests. JavaScript running in the browser can fetch data from a web server with code like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getCurrentVersionNumber(versionCallback) { // Note callback argument
    // Make a scripted HTTP request to a backend version API
    let request = new XMLHttpRequest();
    request.open("GET", "http://www.example.com/api/version");
    request.send();

    // Register a callback that will be invoked when the response arrives
    request.onload = function() {
        if (request.status === 200) {
            // If HTTP status is good, get version number and call callback.
            let currentVersion = parseFloat(request.responseText);
            versionCallback(null, currentVersion);
        } else {
            // Otherwise report an error to the callback
            versionCallback(response.statusText, null);
        }
    };
    // Register another callback that will be invoked for network errors
    request.onerror = request.ontimeout = function(e) {
        versionCallback(e.type, null);
    };
}

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

&lt;/div&gt;



&lt;p&gt;Client-side JavaScript code can use the XMLHttpRequest class plus callback functions to make HTTP requests and asynchronously handle the server’s response when it arrives.&lt;/p&gt;

&lt;p&gt;The getCurrentVersionNumber() function defined here makes an HTTP request and defines event handlers that will be invoked when the server’s response is received or when a timeout or other error causes the request to fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Callbacks and Events in Node&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Node.js server-side JavaScript environment is deeply asynchronous and defines many APIs that use callbacks and events. The default API for reading the contents of a file, for example, is asynchronous and invokes a callback function when the contents of the file have been read.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require("fs"); // The "fs" module has filesystem-related APIs
let options = {           // An object to hold options for our program
    // default options would go here
};

// Read a configuration file, then call the callback function
fs.readFile("config.json", "utf-8", (err, text) =&amp;gt; {
    if (err) {
        // If there was an error, display a warning, but continue
        console.warn("Could not read config file:", err);
    } else {
        // Otherwise, parse the file contents and assign to the options object
        Object.assign(options, JSON.parse(text));
    }

    // In either case, we can now start running the program
    startProgram(options);
});

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

&lt;/div&gt;



&lt;p&gt;Node’s fs.readFile() function takes a two-parameter callback as its last argument. It reads the specified file asynchronously and then invokes the callback. If the file was read successfully, it passes the file contents as the second callback argument. If there was an error, it passes the error as the first callback argument.&lt;/p&gt;

&lt;p&gt;Node also defines a number of event-based APIs. The following function shows how to make an HTTP request for the contents of a URL in Node. It has two layers of asynchronous code handled with event listeners&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const https = require("https");

// Read the text content of the URL and asynchronously pass it to the callback.
function getText(url, callback) {
    // Start an HTTP GET request for the URL
    request = https.get(url);

    // Register a function to handle the "response" event.
    request.on("response", response =&amp;gt; {
        // The response event means that response headers have been received
        let httpStatus = response.statusCode;

        // The body of the HTTP response has not been received yet.
        // So we register more event handlers to to be called when it arrives.
        response.setEncoding("utf-8");  // We're expecting Unicode text
        let body = "";                  // which we will accumulate here.

        // This event handler is called when a chunk of the body is ready
        response.on("data", chunk =&amp;gt; { body += chunk; });

        // This event handler is called when the response is complete
        response.on("end", () =&amp;gt; {
            if (httpStatus === 200) {   // If the HTTP response was good
                callback(null, body);   // Pass response body to the callback
            } else {                    // Otherwise pass an error
                callback(httpStatus, null);
            }
        });
    });

    // We also register an event handler for lower-level network errors
    request.on("error", (err) =&amp;gt; {
        callback(err, null);
    });
}

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How Iterators Work in javascript</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Mon, 23 May 2022 00:19:27 +0000</pubDate>
      <link>https://dev.to/digomic/how-iterators-work-in-javascript-36oi</link>
      <guid>https://dev.to/digomic/how-iterators-work-in-javascript-36oi</guid>
      <description>&lt;p&gt;The term “iteration” is derived from the Latin itero, meaning “repeat” or “do again.” In the context of software, “iteration” means repetitively performing a procedure multiple times, in sequence, and usually with an expectation of termination&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let sum = 0;
for(let i of [1,2,3]) { // Loop once for each of these values
    sum += i;
}
sum   // =&amp;gt; 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Iterators can also be used with the ... operator to expand or “spread” an iterable object into an array initializer or function invocation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let chars = [..."abcd"]; // chars == ["a", "b", "c", "d"]
let data = [1, 2, 3, 4, 5];
Math.max(...data)        // =&amp;gt; 5

//Iterators can be used with destructuring assignment:

let purpleHaze = Uint8Array.of(255, 0, 255, 128);
let [r, g, b, a] = purpleHaze; // a == 128

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

&lt;/div&gt;



&lt;p&gt;When you iterate a Map object, the returned values are [key, value] pairs, which work well with destructuring assignment in a for/of loop&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let m = new Map([["one", 1], ["two", 2]]);
for(let [k,v] of m) console.log(k, v); // Logs 'one 1' and 'two 2'
If you want to iterate just the keys or just the values rather than the pairs, you can use the keys() and values() methods:

[...m]            // =&amp;gt; [["one", 1], ["two", 2]]: default iteration
[...m.entries()]  // =&amp;gt; [["one", 1], ["two", 2]]: entries() method is the same
[...m.keys()]     // =&amp;gt; ["one", "two"]: keys() method iterates just map keys
[...m.values()]   // =&amp;gt; [1, 2]: values() method iterates just map values

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

&lt;/div&gt;



&lt;p&gt;How Iterators Work&lt;/p&gt;

&lt;p&gt;The for/of loop and spread operator work seamlessly with iterable objects, but it is worth understanding what is actually happening to make the iteration work.&lt;/p&gt;

&lt;p&gt;There are three separate types that you need to understand to understand iteration in JavaScript. First, there are the iterable objects: these are types like Array, Set, and Map that can be iterated. Second, there is the iterator object itself, which performs the iteration. And third, there is the iteration result object that holds the result of each step of the iteration.&lt;/p&gt;

&lt;p&gt;An iterable object is any object with a special iterator method that returns an iterator object. An iterator is any object with a next() method that returns an iteration result object.&lt;/p&gt;

&lt;p&gt;And an iteration result object is an object with properties named value and done. To iterate an iterable object, you first call its iterator method to get an iterator object. Then, you call the next() method of the iterator object repeatedly until the returned value has its done property set to true.&lt;/p&gt;

&lt;p&gt;The tricky thing about this is that the iterator method of an iterable object does not have a conventional name but uses the Symbol Symbol.iterator as its name. So a simple for/of loop over an iterable object iterable could also be written the hard way, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let iterable = [99];
let iterator = iterable[Symbol.iterator]();
for(let result = iterator.next(); !result.done; result = iterator.next()) {
    console.log(result.value)  // result.value == 99
}

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

&lt;/div&gt;



&lt;p&gt;The iterator object of the built-in iterable datatypes is itself iterable. (That is, it has a method named Symbol.iterator that just returns itself.) This is occasionally useful in code like the following when you want to iterate though a “partially used” iterator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let list = [1,2,3,4,5];
let iter = list[Symbol.iterator]();
let head = iter.next().value;  // head == 1
let tail = [...iter];          // tail == [2,3,4,5]

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

&lt;/div&gt;



&lt;p&gt;Implementing Iterable Objects&lt;/p&gt;

&lt;p&gt;In order to make a class iterable, you must implement a method whose name is the Symbol Symbol.iterator. That method must return an iterator object that has a next() method. And the next() method must return an iteration result object that has a value property and/or a boolean done property.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//An iterable numeric Range class

/*
 * A Range object represents a range of numbers {x: from &amp;lt;= x &amp;lt;= to}
 * Range defines a has() method for testing whether a given number is a member
 * of the range. Range is iterable and iterates all integers within the range.
 */
class Range {
    constructor (from, to) {
        this.from = from;
        this.to = to;
    }

    // Make a Range act like a Set of numbers
    has(x) { return typeof x === "number" &amp;amp;&amp;amp; this.from &amp;lt;= x &amp;amp;&amp;amp; x &amp;lt;= this.to; }

    // Return string representation of the range using set notation
    toString() { return `{ x | ${this.from} ≤ x ≤ ${this.to} }`; }

    // Make a Range iterable by returning an iterator object.
    // Note that the name of this method is a special symbol, not a string.
    [Symbol.iterator]() {
        // Each iterator instance must iterate the range independently of
        // others. So we need a state variable to track our location in the
        // iteration. We start at the first integer &amp;gt;= from.
        let next = Math.ceil(this.from);  // This is the next value we return
        let last = this.to;               // We won't return anything &amp;gt; this
        return {                          // This is the iterator object
            // This next() method is what makes this an iterator object.
            // It must return an iterator result object.
            next() {
                return (next &amp;lt;= last)   // If we haven't returned last value yet
                    ? { value: next++ } // return next value and increment it
                    : { done: true };   // otherwise indicate that we're done.
            },

            // As a convenience, we make the iterator itself iterable.
            [Symbol.iterator]() { return this; }
        };
    }
}

for(let x of new Range(1,10)) console.log(x); // Logs numbers 1 to 10
[...new Range(-2,2)]

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

&lt;/div&gt;



&lt;p&gt;In addition to making your classes iterable, it can be quite useful to define functions that return iterable values. Consider these iterable-based alternatives to the map() and filter() methods of JavaScript arrays&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Return an iterable object that iterates the result of applying f()
// to each value from the source iterable
function map(iterable, f) {
    let iterator = iterable[Symbol.iterator]();
    return {     // This object is both iterator and iterable
        [Symbol.iterator]() { return this; },
        next() {
            let v = iterator.next();
            if (v.done) {
                return v;
            } else {
                return { value: f(v.value) };
            }
        }
    };
}

// Map a range of integers to their squares and convert to an array
[...map(new Range(1,4), x =&amp;gt; x*x)]  // =&amp;gt; [1, 4, 9, 16]

// Return an iterable object that filters the specified iterable,
// iterating only those elements for which the predicate returns true
function filter(iterable, predicate) {
    let iterator = iterable[Symbol.iterator]();
    return { // This object is both iterator and iterable
        [Symbol.iterator]() { return this; },
        next() {
            for(;;) {
                let v = iterator.next();
                if (v.done || predicate(v.value)) {
                    return v;
                }
            }
        }
    };
}

// Filter a range so we're left with only even numbers
[...filter(new Range(1,10), x =&amp;gt; x % 2 === 0)]  // =&amp;gt; [2,4,6,8,10]

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Functional Programming in javascript</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Sun, 08 May 2022 22:09:42 +0000</pubDate>
      <link>https://dev.to/digomic/functional-programming-in-javascript-m11</link>
      <guid>https://dev.to/digomic/functional-programming-in-javascript-m11</guid>
      <description>&lt;p&gt;JavaScript is not a functional programming language like Lisp or Haskell, but the fact that JavaScript can manipulate functions as objects means that we can use functional programming techniques in JavaScript. Array methods such as map() and reduce() lend themselves particularly well to a functional programming style.&lt;/p&gt;

&lt;p&gt;Processing Arrays with Functions&lt;/p&gt;

&lt;p&gt;Suppose we have an array of numbers and we want to compute the mean and standard deviation of those values. We might do that in nonfunctional style like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let data = [1,1,3,5,5];  // This is our array of numbers

// The mean is the sum of the elements divided by the number of elements
let total = 0;
for(let i = 0; i &amp;lt; data.length; i++) total += data[i];
let mean = total/data.length;  // mean == 3; The mean of our data is 3

// To compute the standard deviation, we first sum the squares of
// the deviation of each element from the mean.
total = 0;
for(let i = 0; i &amp;lt; data.length; i++) {
    let deviation = data[i] - mean;
    total += deviation * deviation;
}
let stddev = Math.sqrt(total/(data.length-1));  // stddev == 2

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

&lt;/div&gt;



&lt;p&gt;We can perform these same computations in concise functional style using the array methods map() and reduce() like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// First, define two simple functions
const sum = (x,y) =&amp;gt; x+y;
const square = x =&amp;gt; x*x;

// Then use those functions with Array methods to compute mean and stddev
let data = [1,1,3,5,5];
let mean = data.reduce(sum)/data.length;  // mean == 3
let deviations = data.map(x =&amp;gt; x-mean);
let stddev = Math.sqrt(deviations.map(square).reduce(sum)/(data.length-1));
stddev  // =&amp;gt; 2

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

&lt;/div&gt;



&lt;p&gt;This new version of the code looks quite different than the first one, but it is still invoking methods on objects, so it has some object-oriented conventions remaining. Let’s write functional versions of the map() and reduce() methods&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const map = function(a, ...args) { return a.map(...args); };
const reduce = function(a, ...args) { return a.reduce(...args); };

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

&lt;/div&gt;



&lt;p&gt;With these map() and reduce() functions defined, our code to compute the mean and standard deviation now looks like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sum = (x,y) =&amp;gt; x+y;
const square = x =&amp;gt; x*x;

let data = [1,1,3,5,5];
let mean = reduce(data, sum)/data.length;
let deviations = map(data, x =&amp;gt; x-mean);
let stddev = Math.sqrt(reduce(map(deviations, square), sum)/(data.length-1));
stddev  // =&amp;gt; 2

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Higher-Order Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A higher-order function is a function that operates on functions, taking one or more functions as arguments and returning a new function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This higher-order function returns a new function that passes its
// arguments to f and returns the logical negation of f's return value;
function not(f) {
    return function(...args) {             // Return a new function
        let result = f.apply(this, args);  // that calls f
        return !result;                    // and negates its result.
    };
}

const even = x =&amp;gt; x % 2 === 0; // A function to determine if a number is even
const odd = not(even);         // A new function that does the opposite
[1,1,3,5,5].every(odd)         // =&amp;gt; true: every element of the array is odd

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

&lt;/div&gt;



&lt;p&gt;This not() function is a higher-order function because it takes a function argument and returns a new function. As another example, consider the mapper() function that follows. It takes a function argument and returns a new function that maps one array to another using that function. This function uses the map() function defined earlier, and it is important that you understand how the two functions are different.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Return a function that expects an array argument and applies f to
// each element, returning the array of return values.
// Contrast this with the map() function from earlier.
function mapper(f) {
    return a =&amp;gt; map(a, f);
}

const increment = x =&amp;gt; x+1;
const incrementAll = mapper(increment);
incrementAll([1,2,3])  // =&amp;gt; [2,3,4]

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

&lt;/div&gt;



&lt;p&gt;Here is another, more general, example that takes two functions, f and g, and returns a new function that computes f(g())&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Return a new function that computes f(g(...)).
// The returned function h passes all of its arguments to g, then passes
// the return value of g to f, then returns the return value of f.
// Both f and g are invoked with the same this value as h was invoked with.
function compose(f, g) {
    return function(...args) {
        // We use call for f because we're passing a single value and
        // apply for g because we're passing an array of values.
        return f.call(this, g.apply(this, args));
    };
}

const sum = (x,y) =&amp;gt; x+y;
const square = x =&amp;gt; x*x;
compose(square, sum)(2,3)  // =&amp;gt; 25; the square of the sum

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Partial Application of Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The bind() method of a function f returns a new function that invokes f in a specified context and with a specified set of arguments. We say that it binds the function to an object and partially applies the arguments. The bind() method partially applies arguments on the left—that is, the arguments you pass to bind() are placed at the start of the argument list that is passed to the original function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// The arguments to this function are passed on the left
function partialLeft(f, ...outerArgs) {
    return function(...innerArgs) { // Return this function
        let args = [...outerArgs, ...innerArgs]; // Build the argument list
        return f.apply(this, args);              // Then invoke f with it
    };
}

// The arguments to this function are passed on the right
function partialRight(f, ...outerArgs) {
    return function(...innerArgs) {  // Return this function
        let args = [...innerArgs, ...outerArgs]; // Build the argument list
        return f.apply(this, args);              // Then invoke f with it
    };
}

// The arguments to this function serve as a template. Undefined values
// in the argument list are filled in with values from the inner set.
function partial(f, ...outerArgs) {
    return function(...innerArgs) {
        let args = [...outerArgs]; // local copy of outer args template
        let innerIndex=0;          // which inner arg is next
        // Loop through the args, filling in undefined values from inner args
        for(let i = 0; i &amp;lt; args.length; i++) {
            if (args[i] === undefined) args[i] = innerArgs[innerIndex++];
        }
        // Now append any remaining inner arguments
        args.push(...innerArgs.slice(innerIndex));
        return f.apply(this, args);
    };
}

// Here is a function with three arguments
const f = function(x,y,z) { return x * (y - z); };
// Notice how these three partial applications differ
partialLeft(f, 2)(3,4)         // =&amp;gt; -2: Bind first argument: 2 * (3 - 4)
partialRight(f, 2)(3,4)        // =&amp;gt;  6: Bind last argument: 3 * (4 - 2)
partial(f, undefined, 2)(3,4)  // =&amp;gt; -6: Bind middle argument: 3 * (2 - 4)

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

&lt;/div&gt;



&lt;p&gt;These partial application functions allow us to easily define interesting functions out of functions we already have defined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const increment = partialLeft(sum, 1);
const cuberoot = partialRight(Math.pow, 1/3);
cuberoot(increment(26))  // =&amp;gt; 3

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

&lt;/div&gt;



&lt;p&gt;Partial application becomes even more interesting when we combine it with other higher-order functions. Here, for example, is a way to define the preceding not() function just shown using composition and partial application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const not = partialLeft(compose, x =&amp;gt; !x);
const even = x =&amp;gt; x % 2 === 0;
const odd = not(even);
const isNumber = not(isNaN);
odd(3) &amp;amp;&amp;amp; isNumber(2)  // =&amp;gt; true

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

&lt;/div&gt;



&lt;p&gt;We can also use composition and partial application to redo our mean and standard deviation calculations in extreme functional style&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// sum() and square() functions are defined above. Here are some more:
const product = (x,y) =&amp;gt; x*y;
const neg = partial(product, -1);
const sqrt = partial(Math.pow, undefined, .5);
const reciprocal = partial(Math.pow, undefined, neg(1));

// Now compute the mean and standard deviation.
let data = [1,1,3,5,5];   // Our data
let mean = product(reduce(data, sum), reciprocal(data.length));
let stddev = sqrt(product(reduce(map(data,
                                     compose(square,
                                             partial(sum, neg(mean)))),
                                 sum),
                          reciprocal(sum(data.length,neg(1)))));
[mean, stddev]  // =&amp;gt; [3, 2]

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

&lt;/div&gt;



&lt;p&gt;Notice that this code to compute mean and standard deviation is entirely function invocations; there are no operators involved, and the number of parentheses has grown so large that this JavaScript is beginning to look like Lisp code.&lt;/p&gt;

&lt;p&gt;Again, this is not a style that I advocate for JavaScript programming, but it is an interesting exercise to see how deeply functional JavaScript code can be.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.tosupport%20me%20for%20more%20content"&gt;support me for more content&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding closures in JavaScript</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Thu, 05 May 2022 04:04:45 +0000</pubDate>
      <link>https://dev.to/digomic/understanding-closures-in-javascript-54pg</link>
      <guid>https://dev.to/digomic/understanding-closures-in-javascript-54pg</guid>
      <description>&lt;p&gt;Closures are functions that have access to variables from another function's scope. This is often accomplished by creating a function inside a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function createComparisonFunction(propertyName) {         
 return function(object1, object2) {
  let value1 = object1[propertyName];
  let value2 = object2[propertyName];

  if (value1 &amp;lt; value2) {
   return -1;
  } else if (value1&amp;gt; value2) {
   return 1;
  } else {
   return 0;
  }
 };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The highlighted lines in this example are part of the inner function (an anonymous function) that is accessing a variable (propertyName) from the outer function. Even after the inner function has been returned and is being used elsewhere, it has access to that variable. This occurs because the inner function's scope chain includes the scope of createComparisonFunction().&lt;/p&gt;

&lt;p&gt;The activation object for the function is initialized with values for arguments and any named arguments. The outer function's activation object is the second object in the scope chain. This process continues for all containing functions until the scope chain terminates with the global execution context.&lt;/p&gt;

&lt;p&gt;As the function executes, variables are looked up in the scope chain for the reading and writing of values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function compare(value1, value2) {
 if (value1 &amp;lt; value2) {
  return -1;
 } else if (value1&amp;gt; value2) {
  return 1;
 } else {
  return 0;
 }
}

let result = compare(5, 10);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code defines a function named compare() that is called in the global execution context. When compare() is called for the first time, a new activation object is created that contains arguments, value1, and value2. The global execution context's variable object is next in the compare() execution context's scope chain, which contains this, result, and compare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The this Object&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using the this object inside closures introduces some complex behaviors. When a function is not defined using the arrow syntax, the this object is bound at runtime based on the context in which a function is executed: when used inside global functions, this is equal to window in nonstrict mode and undefined in strict mode, whereas this is equal to the object when called as an object method.&lt;/p&gt;

&lt;p&gt;Anonymous functions are not bound to an object in this context, meaning the this object points to window unless executing in strict mode. Because of the way closures are written, however, this fact is not always obvious.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.identity = 'The Window';

let object = {
 identity: 'My Object',      
 getIdentityFunc() {
  return function() {
   return this.identity;
  };
 }
};

console.log(object.getIdentityFunc()()); // 'The Window'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember that each function automatically gets two special variables as soon as the function is called: this and arguments. An inner function can never access these variables directly from an outer function. It is possible to allow a closure access to a different this object by storing it in another variable that the closure can access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window.identity = 'The Window';

let object = {
 identity: 'My Object',      
 getIdentityFunc() {
  let that = this;
  return function() {
   return that.identity;
  };
 }
};

console.log(object.getIdentityFunc()()); // 'My Object'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's unlikely that you'll intentionally use the patterns in lines two or three, but it is helpful to know that the value of this can change in unexpected ways when syntax is changed slightly.&lt;/p&gt;

&lt;p&gt;[this link for more information about closures]&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/digomicortU"&gt;support me for more content&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>15 Essential GitHub Repos for Web Developers</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Sat, 30 Apr 2022 19:26:23 +0000</pubDate>
      <link>https://dev.to/digomic/15-essential-github-repos-for-web-developers-2paa</link>
      <guid>https://dev.to/digomic/15-essential-github-repos-for-web-developers-2paa</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/getify/You-Dont-Know-JS"&gt;##  1. getify / You-Dont-Know-JS&lt;/a&gt;&lt;br&gt;
A repo dedicated to the well-known You Don't Know JS book series by Kyle Simpson.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sindresorhus/awesome"&gt;## 2. sindresorhus / awesome&lt;/a&gt;&lt;br&gt;
An ultimate list of resources for all kinds of developers. From JavaScript to Fortran and from Docker to Rails.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/EbookFoundation/free-programming-books"&gt;## 3. EbookFoundation / free-programming-books&lt;/a&gt;&lt;br&gt;
A giant list of completely free programming books in different languages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kamranahmedse/developer-roadmap"&gt;## 4. kamranahmedse / developer-roadmap&lt;/a&gt;&lt;br&gt;
Official repo of a roadmap.sh project. Highly recommend it for people who are only taking the first steps in IT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/anuraghazra/github-readme-stats"&gt;### 5. anuraghazra / github-readme-stats&lt;/a&gt;&lt;br&gt;
A very useful repo in order to bring your GitHub Readme to the next level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jlevy/the-art-of-command-line"&gt;### 6. jlevy/the-art-of-command-line&lt;/a&gt;&lt;br&gt;
All you need for mastering the command line on one page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mbeaudru/modern-js-cheatsheet"&gt;### 7. mbeaudru/modern-js-cheatsheet&lt;/a&gt;&lt;br&gt;
A modern cheatsheet for the JavaScript knowledge you will frequently encounter in your projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/airbnb/javascript"&gt;### 8. airbnb/javascript&lt;/a&gt;&lt;br&gt;
JavaScript Style Guide from Airbnb. Also available on&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/thedaviddias/Front-End-Checklist"&gt;### 9. thedaviddias/Front-End-Checklist&lt;/a&gt;&lt;br&gt;
An exhaustive list of all the elements you need to have before launching your website to production.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/ryanmcdermott/clean-code-javascript"&gt;### 10). ryanmcdermott/clean-code-javascript&lt;/a&gt;&lt;br&gt;
The must-know Clean Code principles adapted for the JavaScript world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bradtraversy/design-resources-for-developers"&gt;### 11. bradtraversy/design-resources-for-developers&lt;/a&gt;&lt;br&gt;
A curated and frequently updated collection of design resources for developers. Graphics, Fonts, Logos, Icons, you name it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/trekhleb/javascript-algorithms"&gt;### 12. trekhleb/javascript-algorithms&lt;/a&gt;&lt;br&gt;
Algorithms and data structures implemented in JavaScript with explanations and links to further readings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/microsoft/Web-Dev-For-Beginners"&gt;### 13. microsoft/Web-Dev-For-Beginners&lt;/a&gt;&lt;br&gt;
A 12-week, 24-lesson Web Dev curriculum made by Microsoft.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sdmg15/Best-websites-a-programmer-should-visit"&gt;### 14. sdmg15/Best-websites-a-programmer-should-visit&lt;/a&gt;&lt;br&gt;
A truly impressive list of all kinds of websites every programmer should visit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/FrontendMasters/learning-roadmap"&gt;### 15. FrontendMasters/learning-roadmap&lt;/a&gt;&lt;br&gt;
A broad learning roadmap from Frontend Masters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I hope you help me to continue uploading content&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.buymeacoffee.com/digomicortU"&gt;https://www.buymeacoffee.com/digomicortU&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>what is an object in javascript?</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Tue, 19 Apr 2022 03:50:59 +0000</pubDate>
      <link>https://dev.to/digomic/what-is-an-object-in-javascript-3j7b</link>
      <guid>https://dev.to/digomic/what-is-an-object-in-javascript-3j7b</guid>
      <description>&lt;p&gt;An object is an unordered collection of properties, each of which has a name and a value. Property names are usually strings, so we can say that objects map strings to values. This string-to-value mapping goes by various names—you are probably already familiar with the fundamental data structure under the name “hash,” “hashtable,” “dictionary,” or “associative array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating Objects&lt;/strong&gt;&lt;br&gt;
Objects can be created with object literals, with the new keyword, and with the Object.create() function. The subsections below describe each technique.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object Literals&lt;/strong&gt;&lt;br&gt;
The easiest way to create an object is to include an object literal in your JavaScript code. an object literal is a comma-separated list of colon-separated name:value pairs, enclosed within curly braces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let empty = {};                          // object with no properties
let point = { x: 0, y: 0 };              // Two numeric properties
let p2 = { x: point.x, y: point.y+1 };   // More complex values
let book = {
    "main title": "JavaScript",          // These property names include spaces,
    "sub-title": "The Definitive Guide", // and hyphens, so use string literals.
    for: "all audiences",                // for is reserved, but no quotes.
    author: {                            // The value of this property is
        firstname: "David",              // itself an object.
        surname: "Flanagan"
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating Objects with new&lt;/strong&gt;&lt;br&gt;
The new operator creates and initializes a new 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 o = new Object();  // Create an empty object: same as {}.
let a = new Array();   // Create an empty array: same as [].
let d = new Date();    // Create a Date object representing the current time
let r = new Map();     // Create a Map object for key/value mapping

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prototypes&lt;/strong&gt;&lt;br&gt;
Almost every JavaScript object has a second JavaScript object associated with it. This second object is known as a prototype, and the first object inherits properties from the prototype.&lt;/p&gt;

&lt;p&gt;All objects created by object literals have the same prototype object, and we can refer to this prototype object in JavaScript code as Object.prototype&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object.create()&lt;/strong&gt;&lt;br&gt;
Object.create() creates a new object, using its first argument as the prototype of that object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  isHuman: false,
  printIntroduction: function() {
    console.log(`My name is ${this.name}. Am I human? ${this.isHuman}`);
  }
};

const me = Object.create(person);

me.name = 'Matthew'; // "name" is a property set on "me", but not on "person"
me.isHuman = true; // inherited properties can be overwritten

me.printIntroduction();
// expected output: "My name is Matthew. Am I human? true"

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deleting Properties&lt;/strong&gt;&lt;br&gt;
The delete operator removes a property from an object. Its single operand should be a property access expression&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete book.author;          // The book object now has no author property.
delete book["main title"];   // Now it doesn't have "main title", either.

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Testing Properties&lt;/strong&gt;&lt;br&gt;
JavaScript objects can be thought of as sets of properties, and it is often useful to be able to test for membership in the set—to check whether an object has a property with a given name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Serializing Objects&lt;/strong&gt;&lt;br&gt;
Object serialization is the process of converting an object’s state to a string from which it can later be restored. The functions JSON.stringify() and JSON.parse() serialize and restore JavaScript objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object Methods&lt;/strong&gt;&lt;br&gt;
The toString() Method&lt;/p&gt;

&lt;p&gt;The toString() method takes no arguments; it returns a string that somehow represents the value of the object on which it is invoked. JavaScript invokes this method of an object whenever it needs to convert the object to a string&lt;/p&gt;

&lt;p&gt;This occurs, for example, when you use the + operator to concatenate a string with an object or when you pass an object to a method that expects a string&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let s = { x: 1, y: 1 }.toString();  // s == "[object Object]"

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

&lt;/div&gt;



&lt;p&gt;Because this default method does not display much useful information, many classes define their own versions of toString() For example, when an array is converted to a string, you obtain a list of the array elements, themselves ea ch converted to a string, and when a function is converted to a string, you obtain the source code for the function. You might define your own toString() method like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let point = {
    x: 1,
    y: 2,
    toString: function() { return `(${this.x}, ${this.y})`; }
};
String(point)    // =&amp;gt; "(1, 2)": toString() is used for string conversions

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;toLocaleString() Method&lt;/strong&gt;&lt;br&gt;
In addition to the basic toString() method, objects all have a toLocaleString(). The purpose of this method is to return a localized string representation of the object. The default toLocaleString() method defined by Object doesn’t do any localization itself: it simply calls toString() and returns that value&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let point = {
    x: 1000,
    y: 2000,
    toString: function() { return `(${this.x}, ${this.y})`; },
    toLocaleString: function() {
        return `(${this.x.toLocaleString()}, ${this.y.toLocaleString()})`;
    }
};
point.toString()        // =&amp;gt; "(1000, 2000)"
point.toLocaleString()  // =&amp;gt; "(1,000, 2,000)": note thousands separators

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The valueOf() Method&lt;/strong&gt;&lt;br&gt;
The valueOf() method is much like the toString() method, but it is called when JavaScript needs to convert an object to some primitive type other than a string—typically, a number. JavaScript calls this method automatically if an object is used in a context where a primitive value is required&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let point = {
    x: 3,
    y: 4,
    valueOf: function() { return Math.hypot(this.x, this.y); }
};
Number(point)  // =&amp;gt; 5: valueOf() is used for conversions to numbers
point &amp;gt; 4      // =&amp;gt; true
point &amp;gt; 5      // =&amp;gt; false
point &amp;lt; 6      // =&amp;gt; true

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;toJSON() Method&lt;/strong&gt;&lt;br&gt;
Object.prototype doe not actually define a toJSON() method, but the JSON.stringify() method looks for a toJSON() method on any object it is asked to serialize. If this method exists on the object to be serialized, it is invoked, and the return value is serialized, instead of the original 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 point = {
    x: 1,
    y: 2,
    toString: function() { return `(${this.x}, ${this.y})`; },
    toJSON: function() { return this.toString(); }
};
JSON.stringify([point])   // =&amp;gt; '["(1, 2)"]'

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Extended Object Literal Syntax&lt;/strong&gt;&lt;br&gt;
Shorthand Properties&lt;br&gt;
Suppose you have values stored in variables x and y and want to create an object with properties named x and y that hold those values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 1, y = 2;
let o = {
    x: x,
    y: y
};

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

&lt;/div&gt;



&lt;p&gt;In ES6 and later, you can drop the colon and one copy of the identifier and end up with much simpler code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = 1, y = 2;
let o = { x, y };
o.x + o.y  // =&amp;gt; 3v

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Computed Property Names&lt;/strong&gt;&lt;br&gt;
Sometimes you need to create an object with a specific property, but the name of that property is not a compile-time constant that you can type literally in your source code. Instead, the property name you need is stored in a variable or is the return value of a function that you invoke.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const PROPERTY_NAME = "p1";
function computePropertyName() { return "p" + 2; }

let o = {};
o[PROPERTY_NAME] = 1;
o[computePropertyName()] = 2;

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

&lt;/div&gt;



&lt;p&gt;It is much simpler to set up an object like this with an ES6 feature known as computed properties that lets you take the square brackets from the preceding code and move them directly into the object literal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const PROPERTY_NAME = "p1";
function computePropertyName() { return "p" + 2; }

let p = {
    [PROPERTY_NAME]: 1,
    [computePropertyName()]: 2
};

p.p1 + p.p2 // =&amp;gt; 3

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Symbols as Property Names&lt;/strong&gt;&lt;br&gt;
The computed property syntax enables one other very important object literal feature. In ES6 and later, property names can be strings or symbols. If you assign a symbol to a variable or constant, then you can use that symbol as a property name using the computed property syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const extension = Symbol("my extension symbol");
let o = {
    [extension]: { /* extension data stored in this object */ }
};
o[extension].x = 0; // This won't conflict with other properties of o

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Spread Operator&lt;/strong&gt;&lt;br&gt;
you can copy the properties of an existing object into a new object using the “spread operator” ... inside an object literal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let position = { x: 0, y: 0 };
let dimensions = { width: 100, height: 75 };
let rect = { ...position, ...dimensions };
rect.x + rect.y + rect.width + rect.height // =&amp;gt; 175

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

&lt;/div&gt;



&lt;p&gt;If the object that is spread and the object it is being spread into both have a property with the same name, then the value of that property will be the one that comes last:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let o = { x: 1 };
let p = { x: 0, ...o };
p.x   // =&amp;gt; 1: the value from object o overrides the initial value
let q = { ...o, x: 2 };
q.x   // =&amp;gt; 2: the value 2 overrides the previous value from o.

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Shorthand Methods&lt;/strong&gt;&lt;br&gt;
When a function is defined as a property of an object, we call that function, you would define a method in an object literal using a function definition expression just as you would define any other property of an 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 square = {
    area: function() { return this.side * this.side; },
    side: 10
};
square.area() // =&amp;gt; 100

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

&lt;/div&gt;



&lt;p&gt;the object literal syntax has been extended to allow a shortcut where the function keyword and the colon are omitted, resulting in code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let square = {
    area() { return this.side * this.side; },
    side: 10
};
square.area() // =&amp;gt; 100

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

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>5 good computer science books to start if you don't know how to start</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Sat, 09 Apr 2022 22:08:20 +0000</pubDate>
      <link>https://dev.to/digomic/5-good-computer-science-books-to-start-if-you-dont-know-how-to-start-3m26</link>
      <guid>https://dev.to/digomic/5-good-computer-science-books-to-start-if-you-dont-know-how-to-start-3m26</guid>
      <description>&lt;p&gt;Computer science is the study of computers and computational systems. It is also a branch of engineering, mathematics, and science.&lt;/p&gt;

&lt;p&gt;Computer scientists research and develop new computer technologies. They design software, networks, and other computer-based tools for people to use. Computer scientists may develop programs that help solve specific problems or automate processes. They may create games or other types of entertainment software that people can use to have fun on their own or with others.&lt;/p&gt;

&lt;p&gt;Some computer scientists work on the design of chips (the microchips that are found in devices like laptops). They may work in teams to develop new chips for smartphones or tablets. Other computer scientists work on improving the security features of computers and networks so they can help protect information from being stolen by hackers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1_ How Computers Really Work&lt;/strong&gt;&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%2Fv60eqrtlriyy8dfu8sux.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%2Fv60eqrtlriyy8dfu8sux.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How Computers Really Work is a hands-on guide to the computing ecosystem: everything from circuits to memory and clock signals, machine code, programming languages, operating systems, and the internet.&lt;/p&gt;

&lt;p&gt;But you won’t just read about these concepts, you’ll test your knowledge with exercises, and practice what you learn with 41 optional hands-on projects. Build digital circuits, craft a guessing game, convert decimal numbers to binary, examine virtual memory usage, run your own web server, and more.&lt;/p&gt;

&lt;p&gt;Explore concepts like how to:&lt;/p&gt;

&lt;p&gt;•Think like a software engineer as you use data to describe a real world concept&lt;br&gt;
•Use Ohm’s and Kirchhoff’s laws to analyze an electrical circuit&lt;br&gt;
•Think like a computer as you practice binary addition and execute a program in your mind, step-by-step&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;2_ Introduction to Computer Organization *&lt;/em&gt;&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%2Fod4zmc17cfzi4e729dz5.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%2Fod4zmc17cfzi4e729dz5.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introduction to Computer Organization gives programmers a practical understanding of what happens in a computer when you execute your code. You may never have to write x86-64 assembly language or design hardware yourself, but knowing how the hardware and software works will give you greater control and confidence over your coding decisions. We start with high level fundamental concepts like memory organization, binary logic, and data types and then explore how they are implemented at the assembly language level.&lt;/p&gt;

&lt;p&gt;The goal isn’t to make you an assembly programmer, but to help you comprehend what happens behind the scenes between running your program and seeing “Hello World” displayed on the screen. Classroom-tested for over a decade, this book will demystify topics like:&lt;/p&gt;

&lt;p&gt;•How to translate a high-level language code into assembly language&lt;br&gt;
•How the operating system manages hardware resources with exceptions and interrupts&lt;br&gt;
•How data is encoded in memory&lt;br&gt;
•How hardware switches handle decimal data&lt;br&gt;
•How program code gets transformed into machine code the computer understands&lt;br&gt;
•How pieces of hardware like the CPU, input/output, and memory interact to make the entire system work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3_ Complete A+ Guide to IT Hardware and Software&lt;/strong&gt;&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%2Fi9ykwbo24774fkvzquj7.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%2Fi9ykwbo24774fkvzquj7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is your all-in-one, real-world, full-color guide to connecting, managing, and troubleshooting modern devices and systems in authentic IT scenarios. Its thorough instruction built on the CompTIA A+ Core 1 (220-1001) and Core 2 (220-1002) exam objectives includes coverage of Windows 10, Mac, Linux, Chrome OS, Android, iOS, cloud-based software, mobile and IoT devices, security, Active Directory, scripting, and other modern techniques and best practices for IT management.&lt;/p&gt;

&lt;p&gt;Award-winning instructor Cheryl Schmidt also addresses widely-used legacy technologiesmaking this the definitive resource for mastering the tools and technologies youll encounter in real IT and business environments. Schmidts emphasis on both technical and soft skills will help you rapidly become a well-qualified, professional, and customer-friendly technician.&lt;/p&gt;

&lt;p&gt;Learning Objectives and chapter opening lists of CompTIA A+ Certification Exam Objectives make sure you know exactly what youll be learning, and you cover all you need to know&lt;/p&gt;

&lt;p&gt;Hundreds of photos, figures, and tables present information in a visually compelling full-color design&lt;/p&gt;

&lt;p&gt;Practical Tech Tips provide real-world IT tech support knowledge&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4_ Computer Science Illuminated, 7th Edition&lt;/strong&gt;&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%2Fx8y4w0l84o4x49gzqrpi.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%2Fx8y4w0l84o4x49gzqrpi.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fully revised aDesigned for the introductory computing and computer science course, the student-friendly Computer Science Illuminated, Seventh Edition provides students with a solid foundation for further study, and offers non-majors a complete introduction to computing. Fully revised and updated, the Seventh Edition of this best-selling text retains the accessibility and in-depth coverage of previous editions, while incorporating all-new material on cutting-edge issues in computer science. Authored by the award-winning team Nell Dale and John nd updated, the Seventh Edition of the best-selling text Computer Science Illuminated retains the accessibility and in-depth coverage of previous editions, while incorporating all-new material on cutting-edge issues in computer science. Authored by the award-winning Nell Dale and John Lewis, Computer Science Illuminated’s unique and innovative layered approach moves through the levels of computing from an organized, language-neutral perspective. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5_ Computer Systems, 5th Edition&lt;/strong&gt;&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%2Fvffq9e1p3waruvq1w16h.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%2Fvffq9e1p3waruvq1w16h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Computer Systems, Fifth Edition provides a clear, detailed, step-by-step introduction to the central concepts in computer organization, assembly language, and computer architecture. It urges students to explore the many dimensions of computer systems through a top-down approach to levels of abstraction. By examining how the different levels of abstraction relate to one another, the text helps students look at computer systems and their components as a unified concept.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>5 books to learn algorithms and Data Structures</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Wed, 30 Mar 2022 22:21:54 +0000</pubDate>
      <link>https://dev.to/digomic/5-books-to-learn-algorithms-and-data-structures-1i45</link>
      <guid>https://dev.to/digomic/5-books-to-learn-algorithms-and-data-structures-1i45</guid>
      <description>&lt;p&gt;What is an Algorithm?&lt;br&gt;
an algorithm (from the Latin, Dixit algorithms and this from the Greek arithmos, which means “number”, perhaps also influenced by the name of the Persian mathematician Al-Khuarismi) 1 is a set of defined and unambiguous instructions or rules, ordered and finite that allows, typically, to solve a problem, perform a computation, process data and carry out other tasks or activities.2 Given an initial state and an input, following the successive steps a final state is reached and a solution is obtained. Algorithms are the object of study of algorithm&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1- 40 Algorithms Every Programmer Should Know&lt;/strong&gt;&lt;br&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%2Flc54k89asppk7lk1r9i7.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%2Flc54k89asppk7lk1r9i7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Algorithms have always played an important role in both the science and practice of computing. Beyond traditional computing, the ability to use algorithms to solve real-world problems is an important skill that any developer or programmer must-have. This book will help you not only to develop the skills to select and use an algorithm to solve real-world problems but also to understand how it works.&lt;/p&gt;

&lt;p&gt;You’ll start with an introduction to algorithms and discover various algorithm design techniques, before exploring how to implement different types of algorithms, such as searching and sorting, with the help of practical examples. As you advance to a more complex set of algorithms, you’ll learn about linear programming, page ranking, and graphs, and even work with machine learning algorithms, understanding the math and logic behind them.&lt;/p&gt;

&lt;p&gt;Further on, case studies such as weather prediction, tweet clustering, and movie recommendation engines will show you how to apply these algorithms optimally. Finally, you’ll become well versed in techniques that enable parallel processing, giving you the ability to use these algorithms for compute-intensive tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2-Advanced Algorithms and Data Structures&lt;/strong&gt;&lt;br&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%2Fdo4eyuxrojrexfz6787f.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%2Fdo4eyuxrojrexfz6787f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Advanced Algorithms and Data Structures introduces a collection of algorithms for complex programming challenges in data analysis, machine learning, and graph computing. You’ll discover cutting-edge approaches to a variety of tricky scenarios. You’ll even learn to design your own data structures for projects that require a custom solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3- Learning Algorithms&lt;/strong&gt;&lt;br&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%2F9s5945j2zrnaxyo2mjlt.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%2F9s5945j2zrnaxyo2mjlt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to writing efficient code, every software professional needs to have an effective working knowledge of algorithms. In this practical book, author George Heineman (Algorithms in a Nutshell) provides concise and informative descriptions of key algorithms that improve coding.&lt;/p&gt;

&lt;p&gt;Software developers, testers, and maintainers will discover how algorithms solve computational problems creatively.&lt;/p&gt;

&lt;p&gt;Each chapter builds on earlier chapters through eye-catching visuals and a steady rollout of essential concepts, including an algorithm analysis to classify the performance of every algorithm presented in the book.&lt;/p&gt;

&lt;p&gt;At the end of each chapter, you’ll get to apply what you’ve learned to a novel challenge problem — simulating the experience you might find in a technical code interview.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4- Grokking Algorithms&lt;/strong&gt;&lt;br&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%2Fuul6o2fsghc7vol2uzqn.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%2Fuul6o2fsghc7vol2uzqn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Grokking Algorithms is a friendly take on this core computer science topic. In it, you’ll learn how to apply common algorithms to the practical programming problems you face every day.&lt;/p&gt;

&lt;p&gt;You’ll start with tasks like sorting and searching. As you build up your skills, you’ll tackle more complex problems like data compression and artificial intelligence. Each carefully presented example includes helpful diagrams and fully annotated code samples in Python.&lt;/p&gt;

&lt;p&gt;By the end of this book, you will have mastered widely applicable algorithms as well as how and when to use them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5- Dive Into Algorithms&lt;/strong&gt;&lt;br&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%2Fbxayq3v1jhb6oxup9f5q.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%2Fbxayq3v1jhb6oxup9f5q.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dive Into Algorithms is a wide-ranging, Pythonic tour of many of the world’s most interesting algorithms. With little more than a bit of computer programming experience and basic high-school math, you’ll explore standard computer science algorithms for searching, sorting, and optimization; human-based algorithms that help us determine how to catch a baseball or eat the right amount at a buffet; and advanced algorithms like ones used in machine learning and artificial intelligence.&lt;/p&gt;

&lt;p&gt;You’ll even explore how ancient Egyptians and Russian peasants used algorithms to multiply numbers, how the ancient Greeks used them to find greatest common divisors, and how Japanese scholars in the age of samurai designed algorithms capable of generating magic squares.&lt;/p&gt;

&lt;p&gt;You’ll explore algorithms that are useful in pure mathematics and learn how mathematical ideas can improve algorithms. You’ll learn about an algorithm for generating continued fractions, one for quick calculations of square roots, and another for generating seemingly random sets of numbers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Codeless Data Structures and Algorithms : Learn DSA Without Writing a Single Line of Code&lt;/strong&gt;&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%2Fxgh6hlo1pwh01hput1su.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%2Fxgh6hlo1pwh01hput1su.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the era of self-taught developers and programmers, essential topics in the industry are frequently learned without a formal academic foundation. A solid grasp of data structures and algorithms (DSA) is imperative for anyone looking to do professional software development and engineering, but classes in the subject can be dry or spend too much time on theory and unnecessary readings.&lt;/p&gt;

&lt;p&gt;Regardless of your programming language background,Codeless Data Structures and Algorithms has you covered.&lt;/p&gt;

&lt;p&gt;In everyday life, algorithms are frequently used to solve certain problems. Some examples are user manuals, which show algorithms for using a device, or instructions that a worker receives from his employer.&lt;/p&gt;

&lt;p&gt;Some examples in mathematics are the multiplication algorithm, to calculate the product, the division algorithm to calculate the quotient of two numbers, the Euclid algorithm to obtain the greatest common divisor of two positive integers, or the Gaussian method to solve a system of linear equations.&lt;/p&gt;

&lt;p&gt;In programming terms, an algorithm is a sequence of logical steps that allows you to solve a problem.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The 5 Best Programming Languages To Learn To Program</title>
      <dc:creator>diego michel</dc:creator>
      <pubDate>Mon, 28 Mar 2022 01:59:24 +0000</pubDate>
      <link>https://dev.to/digomic/the-5-best-programming-languages-to-learn-to-program-2g58</link>
      <guid>https://dev.to/digomic/the-5-best-programming-languages-to-learn-to-program-2g58</guid>
      <description>&lt;p&gt;If you are looking to write your first line of code, you are probably wondering which are the most widely used programming languages or how many programming languages exist. If you want to enter this world or open up to better job fields, you must know which are the best programming languages and, thus, decide what technology to learn, especially if you are starting your career in the web development industry.&lt;/p&gt;

&lt;p&gt;Today, more than ever, you will find many programming language options for creating large software and hardware projects. Some will help you more than others, but this will depend on what you are looking to solve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Python&lt;/strong&gt;&lt;br&gt;
Created by Guido Van Rossum in the 90s, this multi-paradigm and multipurpose language was conceived as a “side-project” like many technologies on this list of most used programming languages. Python has gained a lot of relevance in very popular industries such as Artificial Intelligence, Machine Learning, among others. In 2008 it had a great growth when big changes and new functionalities were introduced in its version Python 3. In fact, the popularity of Python has increased by 30.17% in 2021 compared to 2020, according to the PYPL index. Therefore, we will continue to see great advances and projects brought to reality thanks to this programming language .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5FXAyyOj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4exri8o8bcey35fwf1l3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5FXAyyOj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4exri8o8bcey35fwf1l3.png" alt="Image description" width="880" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Javascript&lt;/strong&gt;&lt;br&gt;
If you are already in the world of web programming, you will surely know that this is one of the most powerful and flexible programming languages. It was created 25 years ago during the “war of web browsers” by employees of the Netscape company.&lt;/p&gt;

&lt;p&gt;According to the TIOBE Index, JavaScript has consistently ranked in the top 10 most used programming languages worldwide and one of the most popular for several years. This object-oriented, prototyping, and multiparadigm programming language is interpreted, that is, it does not require compilation, since it is designed to run in the browser.&lt;/p&gt;

&lt;p&gt;And it is worth mentioning that JavaScript is supported by a huge community. It is the most widely used web programming language in the world, since practically all websites — even if they were built with another language — have some JavaScript in them.&lt;/p&gt;

&lt;p&gt;That is why its great relevance when we talk about the front-end. In addition, large companies have led efforts creating frameworks such as ReactJS from Facebook, AngularJS from Google or NodeJS, which allow code is written in JavaScript to run on the server side, that is, designed for the back-end.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;3. Java&lt;/strong&gt;&lt;br&gt;
Java is one of the most disruptive programming languages in history, since in the 90s many companies developed their tools mainly in C ++, which was complicated and dependent on the platform on which it was developed. James Gosling and his team created technology that promised to be easier to learn. That is why it is one of the most widely used programming languages today.&lt;/p&gt;

&lt;p&gt;This is an object-oriented programming language independent of its platform, so the code that has been written on one machine will also run on another, even with different operating systems thanks to the Java Virtual Machine (or JVM for its acronym).&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;4. TypeScript&lt;/strong&gt;&lt;br&gt;
The growth of TypeScript was exponential in 2020 since Stack Overflow studies at the beginning of that year showed that this relatively new language would be located in the last places of popularity, but at the end of the year, it was among the first 5 most used programming languages in the world.&lt;/p&gt;

&lt;p&gt;This language compiles into native JavaScript and becomes TypeScript code, going through the same JS processes without the browser ‘finding out that this happened. In addition, this programming language offers a complete description of each component of the code and can be used to develop large applications with strict syntax and fewer errors.&lt;/p&gt;

&lt;p&gt;This technology created in 2012 by Microsoft has many functionalities or mechanisms of object-oriented programming, making any application or site built with this programming language more scalable.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;5. PHP&lt;/strong&gt;&lt;br&gt;
This great multipurpose programming language was created in the 90s, initially thought of as a Common Input Interface (or CGI) by Greenlander Rasmus Lerdorf, who used it to maintain his own website (hence the name of this language: “personal homepage”). Since then, PHP has evolved to become the programming language that it is today, used mainly to develop applications on the server-side, guaranteeing stable web pages with good performance.&lt;/p&gt;

&lt;p&gt;Today we see PHP in sixth place in this 2021 programming language ranking, as its popularity has been declining since the arrival of JavaScript in the same decade. However, we must thank this programming language very much, since it has been the technology that has given life to many great tools and platforms that we continue to use today, such as WordPress, Facebook, Gmail, Wikipedia, among others.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k-Qw9neG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3h2ut1bu2uwjzhqy5t14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k-Qw9neG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3h2ut1bu2uwjzhqy5t14.png" alt="Image description" width="711" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
