“use strict”, it defines that the javascript code should be executed in strict mode. Declaration of strict mode: we can declare strict mode by adding “use strict” to beggining of a js function. OUTPUT : With “use strict”: Using a variable without declaring it, is not allowed. Activate debugging in your browser (F12) to see…

There is very difficulties to write JavaScript code without a debugger. Might your code contain syntax errors, or logical errors, that are difficult to diagnose. Searching errors on your code is called debugging. OUTPUT : First Web Page Activate debugging in your browser (Chrome, IE, Firefox) with F12, and select “Console” in the debugger menu.

Finally block provides you benifits of executing your code after try and catch block. the codes on the finally block will execute always when try and catch executed or not. Syntax try { Block of code to try } catch(err) { Block of code to handle errors } finally { Block of code to be…

Try and Catch blocks are used to define errors in JavaScript and throw statement is used to handle this error. The try statement allows to define a block of code to be tested for errors while it is being executed. The catch statement allows to define a block of code to be executed, if an…

An error is a condition or a situation where a block of code which are in running state suddenly stop executing. When our JavaScript code is executing different type of error can occur. These can from a code(writtern by programmer), due to wrong input. OUTPUT :

a sequence of characters that forms a search pattern is known as Regular expression. Syntax /pattern/modifiers; Example : http://crazyeducation.in/programming/java. OUTPUT : Search a string for “crazyeducation”, and display the position of the match: Try it

Type conversion is a process of converting one type to another, which means number type to string and string type to number. JavaScript have 5 data types- number, string, boolean, object and function. JavaScript defined two ways of type conversion : 1. Conversion using function 2. Automatic conversion. The String() method can convert a number…