const ts = [];
for (let i = 0; i < 10000; i++) {
const t = document.createTextNode("Some text goes here.");
ts.push(t);
document.body.append(t);
}
for (const t of ts) {
t.replaceData(0, t.length, "Some new text.");
}
for (const t of ts) {
t.data = "Some new text.";
}
for (const t of ts) {
t.replaceWith(document.createTextNode("Some new text."));
}
for (const t of ts) {
t.parentNode.replaceChild(document.createTextNode("Some new text."), t);
}