const postDate = (fullDate) => {
return `${fullDate.split(" ").splice(1, 2).join(" ")},
${fullDate.split(" ").splice(3, 1).join(" ")}`;
};
I have repeated the above function on three different pages. Any suggestion to not reapeat the same code or any way to export the function??