Updating bootstrap button group buttons and pulling values

Actually it’s not an array but a plain object; you can directly access its properties using the dot notation like so:

var filters = getFilters()

console.log(filters.level)
console.log(filters.location)

So you probably won’t need individual variables. Or if you need to convert it back to an array of key / value pairs for iteration, you can use Object.entries():

// This will give you something like
// [['level', '4'], ['location', '2']]
console.log(Object.entries(filters))