How do I use special characters in JavaScript?
Like HTML, Javascript requires special characters to be encoded. But JavaScript has its own unique way.
- In HTML, and em dash (—) would be:
—. - In Javascript it’s:
u2014
Use the Special Characters Converter to find the correct Unicode character reference, or consult Unicode’s own charts (these are PDFs):