- SettimeOut(): The function execute only one time in the defined time.
- SetInterval() :If not stop execute in the function, works forever in the defined interval time. The function stop execute keyboards in the Ctrl+c keys. Here is example of that.
3.CallBack Function (): We'll use this function somewhere. Example, The function which function when to execute about lets us decide.
The array printing using foreach is as following. I create name is "dizi" new a array. The array printing value. The array assigned to the k variable.
The output in the code of that.
JavaScript's try-catch-finally statement works very similarly to the try-catch-finally encountered in C++ and Java. First the try block is execute until and unless in it is throws an exeption.If the code doesn't throw an exception, then the whole try block is execute.If the code threw an exception inside the try block then the cath block is executed
Last of all,The finaly block is always execute subsequent to the other block.
Catch block and finaly block runs through code in error even if.
Use Strict
Strict mode is a new feature in EsmaScript 5 that allows you to plane a program,or a function. This strict function prevents certain error from being taken and throws more exception.
- Strict mode eliminates some JavaScript silent errors by changing them to throw errors.
- Strict mode fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that’s not strict mode.
- Strict mode prohibits some syntax likely to be defined in future versions of ECMAScript.
- It disables features that are confusing or poorly thought out.
- Strict mode makes it easier to write “secure” JavaScript.
Error because use did not specify the data type of the data variable.
It prevents, or throws errors, when relatively “unsafe” actions are taken (such as gaining
Difference between var and let :
In fact there is not much difference between them same output as seen.
We can also access the "i" variable from the for loop outside the for loop. Writes us the last.
Typed "i" variable outside the loop, but the last value in the for loop.Cause a lot of errors due to scope in complex project.Therefore it causes poor performance.
but if we used LET instead of VAR, that would have happened . as you can see, we can't get out.
(The fact that we want in projects should be in this way. We should only be able to access the "i" variable from within the for loop.
But use to let variable caused error.




















No comments:
Post a Comment