Implement Beautiful Strings in JavaScript