I have a getter to get the value from a cookie.
Now I have 2 cookies by the name shares= and by the name obligations= .
shares=
obligations=
I want to
Here is a pretty short version
function getCookie(n) { let a = `; ${document.cookie}`.match(`;\\s*${n}=([^;]+)`); return a ? a[1] : ''; }
Note that I made use of ES6's template strings to compose the regex expression.