After attempting to answer the question to this post
Another SO post
I noted that this
Function('return "\\101\\40\\171\\145\\154\\154\\157\\167\\40\\142\\165\\164\\164\\157\\156\\56"')()
or
Function('return "\101\40\171\145\154\154\157\167\40\142\165\164\164\157\156\56"')()
both return the same string - "A yellow button."
In regards to the question I linked to above, the JS code snippet is run in a tag.
I have also noted in the past that when working on some JSON strings, that the '\' was needed over '\'
When is it necessary? Why is it necessary? If it is not necessary, then why is it done?
Links and additional reading are helpful to me.
UPDATE: Perhaps I did not ask this question with enough information.
I understand when and why escaping is needed.
What I would like to know are two things
In the link above, the code has two function; one nested in the other like so
Function(
Function(
'return\'\\141\\75\\160\\162\\157\\155\\160\\164\\50\\47\\105\\156\\164\\162\\145\\172\\40\\154\\145\\40\\155\\157\\164\\40\\144\\145\\40\\160\\141\\163\\163\\145\\47\\51\\73\\151\\146\\50\\141\\75\\75\\47\\164\\157\\164\\157\\61\\62\\63\\154\\157\\154\\47\\51\\173\\141\\154\\145\\162\\164\\50\\47\\142\\162\\141\\166\\157\\47\\51\\73\\175\\145\\154\\163\\145\\173\\141\\154\\145\\162\\164\\50\\47\\146\\141\\151\\154\\56\\56\\56\\47\\51\\73\\175\'')())()
This script works as well as this script
Function(
Function('return "\141\75\160\162\157\155\160\164\50\47\105\156\164\162\145\172\40\154\145\40\155\157\164\40\144\145\40\160\141\163\163\145\47\51\73\151\146\50\141\75\75\47\164\157\164\157\61\62\63\154\157\154\47\51\173\141\154\145\162\164\50\47\142\162\141\166\157\47\51\73\175\145\154\163\145\173\141\154\145\162\164\50\47\146\141\151\154\56\56\56\47\51\73\175"')())()
Why, if both scripts work would the "\\" be needed over "\"? Is there something I am missing here?
The second question would be,
Are there fundamental occurances when "\\" would be required over "\"?
I think sventschui is getting there, but not quite yet.