Wintus
9/2/2017 - 1:30 PM

Browser JS utils in ES2015running in Google Chrome

Browser JS utils in ES2015running in Google Chrome

const queryString = url => 
  Array.from(url.searchParams.entries())
  .reduce(
    (obj, [key, value]) => Object.assign(obj, { [key]: value })
    , {});

var qs = queryString(new URL(location))

console.log(qs)
document.documentMode && document.documentMode < 11 && alert("Browser below IE11 is unsupported.");
document.documentMode || console.log("No more IE.");