---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# URLSearchParams.sort()

The **`URLSearchParams.sort()`** method sorts all key/value
pairs contained in this object in place and returns `undefined`. The sort
order is according to unicode code points of the keys. This method uses a stable sorting
algorithm (i.e. the relative order between key/value pairs with equal keys will be
preserved).

## Syntax

```js
sort()
```

### Parameters

None.

### Return value

None `undefined`.
