bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

JavaScript 1999 (ES3)

ECMAScript 3 (1999)

The first revision to JavaScript .

ECMAScript 1999 is also known as ES3.

ES3 Features

FeatureDescription
Regular expressionsSequence of characters that forms a search pattern
Error handling (try...catch)Statement to define code blocks to be tested in case of an error
The switch keywordSelects code blocks to be executed based on a conditions
The do...while loopA variant of the while loop

Browser Support

JavaScript 1999 is supported in all browsers:

ChromeIE/EdgeFirefoxSafariOpera

Regular Expressions

A sequence of characters that forms a search pattern.

Example

let text = "Visit ExampleSite";
let n = text.search(/ExampleSite/i);

The try...catch Keywords

Statement to define code blocks to be tested in case of an error.

Examples

let x = 5;
try {
  x = y + 1;
} catch(err) {
let text = err.name;
}

The switch Keyword

Based on a condition, switch selects one or more code blocks to be executed.

switch (new Date().getDay()) {
 case 0:
 day = "Sunday";
 break;
 case 1:
 day = "Monday";
 break;
 case 2:
 day = "Tuesday";
 break;
 case 3:
 day = "Wednesday";
 break;
 case 4:
 day = "Thursday";
 break;
 case 5:
 day = "Friday";
 break;
 case 6:
 day = "Saturday";
}

The do...while Loop

The do while runs at least once, even if the condition is false from the start.

This is because the code block is executed before the condition is tested:

do {
 text += "The number is " + i;
 i++;
}
while (i < 10);

Do not forget to increase the variable used in the condition, otherwise the loop will never end!

Previous

JavaScript 2009 (ES5)

Next

JavaScript Versions

This chapter

Overview
32

Lessons

180m

Read time

1. JavaScript Errors2. JavaScript Debugging3. JavaScript Statements4. Project - localStorage Counter5. ECMAScript 20266. JavaScript Silent Errors7. JavaScript Debugging Console8. JavaScript Reserved Words9. Project - Event Listener10. ECMAScript 202511. JavaScript Error Statements12. JavaScript Debugging Breakpoints13. JavaScript Operator Precedence14. Project - To-Do List15. ECMAScript 202416. JavaScript Debugging Errors17. Project - Modal Popup18. ECMAScript 202319. JavaScript Debugging Async20. Project - Form Validation21. ECMAScript 202222. ECMAScript 202123. ECMAScript 202024. ECMAScript 201925. ECMAScript 201826. ECMAScript 201727. ECMAScript 201628. Javascript 2015 (ES6)29. JavaScript 2009 (ES5)30. JavaScript 1999 (ES3)31. JavaScript Versions32. JavaScript History

On this page

ECMAScript 3 (1999)ES3 FeaturesBrowser SupportRegular ExpressionsThe try...catch KeywordsThe switch KeywordThe do...while Loop