Skip to content

Instantly share code, notes, and snippets.

@michel47
Last active July 12, 2021 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michel47/42835214f63750080a8cb73d4be5a4a1 to your computer and use it in GitHub Desktop.
Save michel47/42835214f63750080a8cb73d4be5a4a1 to your computer and use it in GitHub Desktop.
Code Test
<!DOCTYPE html><meta charset="utf8">
<p>testing <a href=code.js title=code.js>code.js</a>...
<br>check the console!</p>
<script src="code.js"></script>
// constructing a query-string from a map (hash-table)!
let hash = {
"k1": "v1",
"k2": "v2",
"k3": "v3",
"k4": "v4" };
let queries = Object.keys(hash).map( k => k +'='+ hash[k] ).join('&');
console.log('queries:',queries);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment