I appreciate your point of view. But if you look at resources such as W3C and even various writings about JavaScript in books such as Professional JavaScript for Web Developers they do mention them as character literals and many times as string literals as well. I do understand where you are coming from and the logic behind what you are saying, but this literal syntax also always you to use unicode characters and print them to strings. It's probably that reason they refer to this as Character Literals!
Can't share the image from the book on this comment but here is a post from stack overflow talking about the same stackoverflow.com/q/28858138/8456836
That's interesting, but I think that's referring to a different concept again. For example, "A" uses a character literal, but "\x41" doesn't (even though they are the same string). So in the case of escaping newlines, "\n" doesn't use a character literal, whereas
Hmm I would agree to that looking at the logic! How about chnaging the title to escape characters and having a genral approach towads it rather than refering to a specific escape charater that generatds charater literals 👍
I appreciate your point of view. But if you look at resources such as W3C and even various writings about JavaScript in books such as Professional JavaScript for Web Developers they do mention them as character literals and many times as string literals as well. I do understand where you are coming from and the logic behind what you are saying, but this literal syntax also always you to use unicode characters and print them to strings. It's probably that reason they refer to this as Character Literals!
Can't share the image from the book on this comment but here is a post from stack overflow talking about the same
stackoverflow.com/q/28858138/8456836
That's interesting, but I think that's referring to a different concept again. For example,
"A"
uses a character literal, but"\x41"
doesn't (even though they are the same string). So in the case of escaping newlines,"\n"
doesn't use a character literal, whereasdoes.
Hmm I would agree to that looking at the logic! How about chnaging the title to escape characters and having a genral approach towads it rather than refering to a specific escape charater that generatds charater literals 👍
Yes, personally I'd call them "escape sequences" (with
\
being the "escape character").Anyway, nice article! 😁
Yes agreed 💯