JavaScript If-else

JavaScript If-else

JavaScript If-else The JavaScript if-else statement is use for executing the code whether condition is true or false. There are 3 forms of if statement in JavaScript. 1) if Statement2) if else statement3) if else if statement JavaScript If statement It evaluates the content only if the given expression is true. The example for JavaScript …

Continue Reading…… JavaScript If-else

JavaScript Operators

JavaScript Operators

JavaScript Operators JavaScript operators are symbols which are use to perform operations on operands. For example: var sum=22-15; Here, the “-” operator is the arithmetic operator and “=” is the assignment operator we have used above. JavaScript has the following types of operators. Arithmetic Operators Comparison (Relational) Operators Bitwise Operators Logical Operators Assignment Operators Special …

Continue Reading…… JavaScript Operators

Javascript Data Types

Javascript Data Types

Javascript Data Types As we use different different values, JavaScript provides different data types to hold these different types of values. There are mainly two types of data types in JavaScript Primitive data type Non-primitive (reference) data type JavaScript is a dynamic type language, this means that you do not need to specify the type …

Continue Reading…… Javascript Data Types

JavaScript Global Variable

JavaScript Global Variable

JavaScript Global Variable A JavaScript global variable is declared outside the function or with a window object. You can access it from any function. Let’s look at a simple example of a global variable in JavaScript. <script> var value=50;//global variable function a(){ alert(value); } function b(){ alert(value); } </script> Declaration of JavaScript global variables within …

Continue Reading…… JavaScript Global Variable

JavaScript variables

JavaScript variables

Variables in JavaScript In most of the cases, a JavaScript application needs to work with some information. But there is something we need to store that information. So, its a variable in which we can store our valuable data or information .Here we gave two examples to make better understanding about javascript variables. Let’s see. …

Continue Reading…… JavaScript variables

External JavaScript file

External JavaScript file

External JavaScript file We can create an external JavaScript file and embed it in several html pages. It provides code re-usability because single JavaScript file can be use in several html pages. It is must to save an external JavaScript file by .js extension. We recommend you to embed all JavaScript files into a single …

Continue Reading…… External JavaScript file

JavaScript Example

JavaScript Example

JavaScript Example: Let’s have a look on the simple JavaScript example. <script>document.write(“Hello JavaScript by JavaScript”);</script> What You Can Do with JavaScript There are so many things that you can do with JavaScript. You can: modify the content of a web page by adding or removing elements. change the style and position of the elements on …

Continue Reading…… JavaScript Example

Features of JavaScript

Features of JavaScript

JavaScript has the following features: All popular web browsers support JavaScript because they provide a built-in execution environment. As JavaScript follows the syntax & structure of the C programming language. Thus, it is a structured programming language. JavaScript is a weakly typed language, where some types are implicitly inserted (depending on the operation). JavaScript is …

Continue Reading…… Features of JavaScript

Advantages of JavaScript

Advantages of JavaScript

Let’s know which advantages JavaScript provides us: Speed The first advantages of JavaScript is that it tends to be in no time. Because it’s often run immediately within the client’s browser. So that it doesn’t require any outside resources. JavaScript has not caught up by calls to a backend server. Also, all major browsers support …

Continue Reading…… Advantages of JavaScript