Js prototype
html
JavaScript
<div id="output"></div>
<script>
String.prototype.affiche = function () { // => function don't permit "this"
document.getElementById('output').innerHTML = this;
}
let text1 = "Text to display one";
let text2 = "Text to display two";
</script>
<button onclick="text1.affiche();">text1.affiche()</button>
<button onclick="text2.affiche();">text2.affiche()</button>