Get Url Without Query String Javascript Mdn Array Slice