在anchorStr后插入joinStr
const joinStr = (str, anchorStr, joinStr) =>
str.replace(anchorStr, anchorStr.concat(joinStr))
const str = 'it is code.'
console.log(joinStr(str, `it is `, 'js ')) // it is js code.
原理就是把anchorStr和joinStr连起来,然后替换掉原来字符串中的anchorStr