alert("\7") does not give you an empty string, it gives you a string with character 7. This is because the browser you are testing expands the definition of a string literal to allow escaping of octal characters, as described in Section B.1.2 specifications .
Since 9 not an octal digit, \9 not interpreted as an escape sequence of the octal character, so the backslash is silently discarded.
Please note that in the corresponding implementation, if you were in strict mode, alert("\7") did not work either, as you can see here with Chrome, Firefox or another browser that supports strict mode: Live Copy | A source
(function() { "use strict"; alert("\7");
source share