@hlfan commented on this pull request.


> @@ -15,10 +15,9 @@ window.onload = function () {
   var query = (window.location.search || '?').slice(1),
       args  = {};
 
-  var pairs = query.split('&');
-  for (var i = 0; i < pairs.length; i++) {
-    var parts = pairs[i].split('=');
-    args[parts[0]] = decodeURIComponent(parts[1] || '');
+  for (var pair of query.split('&')) {
+    var [key, val] = pair.split('=');
+    args[key] = decodeURIComponent(val || '');
   }

@HolgerJeromin there's even a
```js
urlArgs.has('theme', 'dark')
```
that we [can't yet 
use](//caniuse.com/mdn-api_urlsearchparams_has_value_parameter) since it's only 
around since mid 2023.
I cast it back to an object meanwhile.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5522#discussion_r1925875200
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5522/review/2568128...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to