GLOBAL CONTEXT:code that is in the script, but not in a function.
There is only one global context in any page.
FUNCTION CONTEXT:code that is being run within a function.
Each function has its own function context.
GLOBAL SCOPE:when declared a variable outside a function, it can be used anywhere because it has global scope.FUNCTION-LEVEL SCOPE:when a variable is declared within a function,it can only be used within that function.prepare:the new scope is created,and the variables, functions, and arguments are created,the value of the this keyword is determined.execute:now it can assign values to variables,reference functions and run their code,execute statements.ERROR OBJECTS:error objects can help you find where your mistakes are and browsers have tools to help you read them.
It will be appear in the JavaScript console/Error console of the browser.
TYPES OF ERRORS:
SYNTAX IS NOT CORRECT,this is caused by incorrect use of the rules of the language. It is often the result of a simple typo.VARIABLE DOES NOT EXIST,this is caused by a variable that is not declared or is out of scope.VALUE IS UNEXPECTED DATA TYPE,this is often caused by trying to use an object or method that does not exist.NUMBER OUTSIDE OF RANGE,if you call a function using numbers outside of its accepted range.GENERIC ERROR OBJECT,the generic Error object is the template or prototype from which all other error objects are
created.NOT AN ERROR,if you perform a mathematical operation using a value that is not a number, you end up with the
value of NaN, not a type error.HOW TO DEAL WITH ERRORS
A DEBUGGING WORKFLOW TECHNIQUES
The JavaScript console will tell you when there is a problem with a script,where to look for the problem, and what kind of issue it seems to be.
In the internet console, the console will show you when there is an error in your JavaScript. It also displays the line where it became a problem for the interpreter.
DEBUGGING TIPS
CODE PLAYGROUNDSVALIDATION TOOLS that can help you try to find errors in your code.
For JAVASCRIPT
http://www.jslint.com,,,,http://www.jshint .com
COMMON ERRORSGO BACK TO BASICS:javaScript is case sensitive so check your capitalization.MISSED/ EXTRA CHARACTERS:every statement should end in a semicolon.DATA TYPE ISSUES:using= rather than == will assign a value to a variable, not check that the values match.<An over all about Error Handling & Debugging>
@Jon Duckett/JAVASCRIPT