Created
August 15, 2022 15:29
-
-
Save JohnMarkT/0b5a5d0e901cd488e940e9435788ae45 to your computer and use it in GitHub Desktop.
Create a delimited string of params from an object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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