diff --git a/assets/javascripts/lib/ajax.js b/assets/javascripts/lib/ajax.js index 2445cc96..809b7472 100644 --- a/assets/javascripts/lib/ajax.js +++ b/assets/javascripts/lib/ajax.js @@ -59,14 +59,12 @@ var serializeData = function (options) { }; var serializeParams = (params) => - (() => { - const result = []; - for (var key in params) { - var value = params[key]; - result.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); - } - return result; - })().join("&"); + Object.entries(params) + .map( + ([key, value]) => + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`, + ) + .join("&"); var applyCallbacks = function (xhr, options) { if (!options.async) {