This seems overkill if all you to know is whether there's a query argument "x=y" in window.location. Why not `detailsEnabled = window.location.indexOf("details=true") > -1;`?