JSFiddle - React, Tailwind, and code Playground

JavaScript

String.prototype.replaceAt=function(index, character) {
          return this.substr(0, index) + character + this.substr(index+character.length);
       }
       var hello="ratul";
       alert(hello.replaceAt(0, "z"));