function reverse(str) {
return str.split("").reverse().join("");
}
SmartyPants converts ASCII punctuation characters into "smart" typographic punctuation HTML entities. For example:
| ARRAY | OBJECT | STRING | Integer |
|---|---|---|---|
| Single backticks | 'Isn't this fun?' |
'Isn't this fun?' | 'Isn't this fun?' |
| Quotes | "Isn't this fun?" |
"Isn't this fun?" | "Isn't this fun?" |
| Dashes | -- is en-dash, --- is em-dash |
-- is en-dash, --- is em-dash | "Isn't this fun?" |