Escaping is the process of treating special characters in a string literal so they are interpreted as plain text instead of having their usual special meaning. It's commonly used when dealing with user input or constructing SQL queries to avoid injection attacks, because nobody wants to be the next Equifax.
I was trying to debug why the search wasn't working on the new e-commerce site, but then I realized some genius forgot to add escaping to the product descriptions and now everything's jacked up with rogue HTML tags.
When I saw all the escaping backslashes in the regular expression Dave wrote, I knew it was going to be a long day of code review and questioning my life choices.
Read about the various escaping mechanisms used in JavaScript and weep for the poor souls who have to remember all that.
Check out OWASP's XSS Prevention Cheat Sheet for tips on escaping output to avoid cross-site scripting vulnerabilities, because you don't want your site hacked by script kiddies.
If you really want to nerd out, dive into the nitty-gritty details of character escaping in the JSON spec. Perfect bedtime reading material.
Note: the Developer Dictionary is in Beta. Please direct feedback to skye@statsig.com.