To write a link in javascript the html parts must be in quotes single ' or double " javascript variables are not in quotes the parts are added together with + in this example double quotes are used in the html [ href=" " ]so you must use single quotes to surround the html parts
[ ' <a href=" ' ] + name + [ ' "> ' ] + text + [ ' </a> ' ]