Güven Altuntaş Güven Altuntaş - 1 year ago 58
Javascript Question

Why javascript can't use £ as function name

I wonder that why javascript can use $ (dollar sign) as function name but can't use pound sign (£). Is there a logic or limitation for that?

edit: This question not duplicate of given question. and theres no source for the answer in this site. This is like "hey this is javascript catalog find you're looking for in it"

Answer Source

No, there's no particular logic to it, it's just the rules that Brendan Eich decided on during those fraught ten days in May 1995. The full rules are here. Eich just decided that allowing $ in identifier names would be handy. He also allowed _ (which is more common in programming languages), as well as the usual set of English letters and numbers (where numbers can't appear in the first character).

Ultimately, a wide range of Unicode characters were allowed (for instance, fairly famously, ಠ_ಠ is a valid JavaScript identifier), but that was much later, in the ECMAScript 3rd edition (implemented by Mozilla in JavaScript 1.5).