User:Oshwah/sandbox.js

/* var url = "https://www.mediawiki.org/w/api.php";

var params = { action: "query", prop: "revisions", titles: "User:Oshwah", rvprop: "ids", rvlimit: "1", formatversion: "2", format: "json" };

url = url + "?origin=*"; Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];});

fetch(url) .then(function(response){return response.json;}) .then(function(response) {       var pages = response.query.pages;        for (var p in pages) {            console.log(pages[p].revisions);        }    }) .catch(function(error){console.log(error);});