function filterUrlParams() { let str = window.location.search.replace('?', '') let arr = str.split('&') let obj = {} arr.map(e => { let key = e.split('=') obj[key[0]] = key[1] }) return obj };