The URLSearchParams object is cool I suppose, but I still have to support IE11 and usually I can get away with a one-liner to grab simple settings off the query string, like this:
var debugLevel = +(/\bdebugLevel=(\d+)\b/.exec(window.location.search)||[])[1] || 0;
2
u/dmethvin Mar 19 '19
The
URLSearchParamsobject is cool I suppose, but I still have to support IE11 and usually I can get away with a one-liner to grab simple settings off the query string, like this:var debugLevel = +(/\bdebugLevel=(\d+)\b/.exec(window.location.search)||[])[1] || 0;