SyntaxError : Reserved Word

Posted by Robin Jangu | April 16, 2018
Debug • Miscellaneous •

11196 Views | 2 Min Read

SyntaxError : Reserved Word

Remember when you were a mere beginner in JavaScript, while learning you must have come across the term ‘reserved words’. These are the words that you can’t use as names for variables. Apart from mainstream keywords like break, var, if…else etc. there are many more reserved keywords.

Following will be the error messages you will receive if by accident you use such words. Seasoned JS developers too commit such blunders while scripting.

Strict mode

Strict mode has become a necessity because of its many benefits. It keeps in check and streamlines the code flow, error debugging too becomes very easy. I wouldn’t say that it has shortcomings but you need to be extra careful while implementing this.

In addition to the already existing reserved keywords, Strict mode reserves a few more keywords like implements, interface, let, package, private, protected, public, as, yield and static.

Unexpected syntax error

Now we change the variable name to avengerEnemy, now it will work.

error debugging, reserved keywords

If you still get the same error, it may be due to the outdated browser version. Try updating the browser, as the old versions have old reserved words that need to be revised.
Happy scripting!

LambdaTest, Cross browser testing

Written by Robin Jangu

Related Articles

Our 19 Most Popular Blogs Of 2019

Our 19 Most Popular Blogs Of 2019

72000 Views | 10 Min Min Read

2 thoughts on “Top 21 Selenium Automation Testing Blogs To Look Out In 2020

  1. excellent post, very informative. I’m wondering why the opposite experts of this sector don’t understand this.
    You should proceed your writing. I am sure, you have a huge readers’ base already!

  2. Pretty great post. I just stumbled upon your weblog and wished to say that I’ve truly loved surfing around your weblog posts.

    In any case I’ll be subscribing for your rss feed and I’m hoping you
    write once more soon!

Leave a Reply

Your email address will not be published. Required fields are marked *