Skip to content

Latest commit

 

History

History

javascript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
layout title has_children permalink
default
Javascript
true
/js

Create shareable get param URLs using history.replaceState

// Create new URL
var url = new URL(window.location.href);
var search_params = new URLSearchParams();

// We wish to set the following param to the URL
search_params.set("param1", "value1");
url.search = search_params;
history.replaceState(null, "", url.search.toString());

Pipes in JS

Source: https://medium.com/@venomnert/pipe-function-in-javascript-8a22097a538e

const _pipe = (a, b) => (arg) => b(a(arg));
const pipe = (...ops) => ops.reduce(_pipe)

Links