Type Conversion in JavaScript

Type Conversion in JavaScript means converting one data type to another. JavaScript data type or variables can be converted into a different variable and/or different data type by the following ways: Using JavaScript methods By JavaScript itself (automatically) Converting Numbers to Strings Using JavaScript method The JavaScript function String() can convert numbers into strings. String() can take … Read more

This Keyword in JavaScript

This keyword refers to an object, that object which is executing the current bit of JavaScript code. JavaScript function while executing has a reference to its current execution of any function, called this. JavaScript function while executing has a reference to its current execution of any function, called this. with this keyword, It does not matter how and where … Read more

JavaScript variables

Variable is a user given name to a memory location where user can store values and can access it using variable name. user can give any valid variable name to store data. Variables can store different types of data like integer,character,string, boolean,real values etc. Syntax

for all kind of variable we use var keyword … Read more

Operator Precedence and associativity in JavaScript

Operator Precedence Operator precedence determines the order in which operators are evaluated when more than one operator is used in an expression. The higher an operator’s precedence, the earlier it is evaluated in comparison with the operators with lower precedence. Consider the following example:

The above expression is evaluated in the order of the … Read more

Hoisting in JavaScript

What is Hoisting? Hoisting is when the JavaScript interpreter moves all variable and function declarations to the top of the current scope. Hoisting is done during the interpreter’s first run through the code. The important thing is that the actual declarations are hoisted, and that assignments will be left where they are. Hoisting is a … Read more

JavaScript Syntax

JavaScript Keywords JavaScript keywords are some reserved words that can’t be used as identifier and are used to identify actions to be performed e.g., the var keyword tells the browser to declare variables in JavaScript. Here is the list of JavaScript keywords: abstract arguments await boolean break byte case catch char class const continue debugger default delete do double … Read more

Data Object in JavaScript

The Date object is a datatype, Date objects are created with the new Date( ), Most of “Date” methods simply allow you to get and set the year, month, day, hour, minute, second. If no arguments are provided, the constructor creates a JavaScript Date object for the current date and time according to system settings for timezone offset. … Read more

JavaScript Inclusion in HTML File

Javascript in Internal File You can place JavaScript code on HTML pages anywhere within<html> tags(within <body>tag as well as <head> tag) JavaScript code must be inside <script> tag for aninternal placement. Within <head> tag

Within <body> tag

External JavaScript To use JavaScript from an external file source, all JavaScript source code must be written … Read more

Regular Expression in JavaScript

What is a Regular Expression(RegEx)? Regular expressions/sequence of characters are patterns used to match character combinations in strings. A regEx can be a single character or a complicated pattern. Regular expressions can be used to perform text search and validation operations. Special characters in regular expressions Character Meaning ^ It Matches the beginning of an input e.g., … Read more