Replacing GitHub usernames with links
The function you want is replace:

function link_ats(text) { 
    return text.replace( /@(\w+)/g, '&lt;a href=https://github.com/$1&gt;@$1&lt;/a&gt;' ) 
}

document.getElementById("bio").innerHTML = link_ats("The coolest company to work for is @github!  There is also @aws and @microsoft.", "bio");