Cookie Parser 구현 중 produce의 사용법이 궁금해졌음.
Starting with the Curiosity of produce which is one of the prototype functions of Array.
const beTargeted = {};
const cookieParser = (cookiestr = "") => {
return cookiestr
.split(";")
.map((cookie) => cookie.split("="))
.reduce((target, [K, V]) => {
// console.log(target, K, V);
target[K] = V;
return target;
}, beTargeted);
};