JavaScript of Today
1.Type of Data Type: There are basically two types of data type in javascript.
1. Primitive data type
2. Non primitive data type.
2. primative data type: Everything in JavaScript is an object, but without primitive data type.Because these are not objects.
Example:
Number: It can be any type of number starting from a normal number. and it can even be decimal.
String : string means double quotation (“ “ ) and single quotation ( ‘ ‘ ).
Whatever is In this quotation, it will be treated as a string.
Boolean :True or false, must be lowercase letter, not only that see the false. letter don’t be acceptable.
Undefined :After declaring the variable, if you do not use any data, it will show undipine.
3.Non primitive data type: Non primitive data type are not saved directly. Rather the value reference remains saved. and in this date type are object. because that they also have a lot of experience.
Example:
Array.
Object.
Function.
4.Comment : Comments are a very helpful method for all programmers. The only way to write down what you have used in the code is to comment.Because after many months, when you see your code,you may not remember it.so the only way to remember the code at that time is to comment on the code.
…….Error handling…….
5.Syntex Error: SyntaxError is thrown if you try to evaluate code with a syntax error.
Example :
6.TypeError : A TypeError is thrown if you use a value that is outside the range of expected types.
Example:
7.ReferenceError: A Reference is thrown if you use (variable) a variable that has not been declared.
Example:
8.Range Error : A RangeError is thrown if you use a number that is outside the range of legal values.
For example: You cannot set the number of significant digits of a number to 500.
9.Codding Style: A good quality of a programmer is to write the coding a little neatlyy As such, we have to organize the codes well .Below is a better picture.
Example :
10. try…catch…throw
The try statement used to test a block of code for errors.
The catch statement used to handle the error.
The throw statement used to create custom errors by the programmer.