I am reading a book about JavaScript where I read about reserved words, I tried all the reserved words to us as an identifier but no one is allowed except 'abstract', I am still able to use 'abstract' as an identifier even it is a reserved word! I tried Internet Explorer, Chrome, Firefox and it is working as an identifier, why is it still allowed as an identifier even it is a reserved word? Thanks
function myFunction(a, b) {
abstract = a+b;
alert("Sum = "+abstract);
}
<!DOCTYPE html>
<html>
<head>
<title>TestScript</title>
</head>
<body>
<button onclick="myFunction(20, 5)">Try it</button>
</body>
</html>
There are tons of "future" reserved words which aren't actually reserved, because the don't yet do anything. Many of them will never do anything.
For example,
synchronized
is also a reserved word, butvar synchronized = true
probably works in most browsers. Same fornative
,boolean
,transient
etc.