JSFiddle - React, Tailwind, and code Playground

by holf

JavaScript

var stuff = "yay1 yay2 yay3";
var i = 1;
result = stuff.replace(/yay/g, new function(){
return i;
});

console.log(result);