Skip to content

Instantly share code, notes, and snippets.

@JohnMarkT
Created August 15, 2022 15:29
Show Gist options
  • Save JohnMarkT/0b5a5d0e901cd488e940e9435788ae45 to your computer and use it in GitHub Desktop.
Save JohnMarkT/0b5a5d0e901cd488e940e9435788ae45 to your computer and use it in GitHub Desktop.
Create a delimited string of params from an object
function createDelimitedParams(obj = {}, keyValDelimiter = '=', paramDelimiter = '&') {
return Object.entries(obj)
.map(entry => entry.join(keyValDelimiter))
.join(paramDelimiter);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment