标签: javascript design-patterns
使用如下构造有什么好处:
return "FIRTNAME LASTNAME" .replace(/FIRSTNAME/g, person.firstName) .replace(/LASTNAME/g, person.lastName)
与简单的return person.firstName + " " + person.lastName比较 ?
return person.firstName + " " + person.lastName