JSFiddle - React, Tailwind, and code Playground
JavaScript
const text = ["a %s b %s c %s", 1, 2, 3, 4];
//const res = text[0].replace.apply(text[0], [/\%s/gm].concat(text.slice(1)));
const res = text[0].replace(/\%s/, 1, 2, 3, 4)
console.log(res)
const text = ["a %s b %s c %s", 1, 2, 3, 4];
//const res = text[0].replace.apply(text[0], [/\%s/gm].concat(text.slice(1)));
const res = text[0].replace(/\%s/, 1, 2, 3, 4)
console.log(res)