JSFiddle - React, Tailwind, and code Playground

by ozzon91

JavaScript

!function() {
    'use strict';
    let xhr = new XMLHttpRequest();
    
    xhr.open('GET', 'https://randomuser.me/api/', true);
    
    xhr.onreadystatechange = function() {
        if ( 4 != xhr.readyState ) {
            return;
        }
        if ( 200 != xhr.status ) {
            return;
        }
        console.log( JSON.parse(xhr.responseText) );
    }
    
    xhr.send();
}();