Popup Box in JavaScript

JavaScript supports three types of dialog boxes: Alert box Confirmation box Pop up box Alert Box An alert dialog box is mostly used to give a warning message to the users especially for validation purposes when a use inputs some wrong data, we can use an alert box to display a warning message. The drawback … Read more

Functions in JavaScript

What is a Function? A function is a block of code or a subprogram designed to perform a particular task. Function is executed only when it is called. This is called invoking/calling a function. Thus it eliminates writing the same code again and again. Values can be passed into functions and used within the function body. Function always returns a value, if no return type … Read more

Operators in JavaScript

What is an operator? Consider a simple expression 2 + 5 equals to 7. Here, 2 and 5 are called operands and the ‘+’ is called operator. JavaScript supports the following 5 types of operators: Arithmetic Operators Comparison Operators Logical (or Relational) Operators Assignment Operators Conditional (or ternary) Operators  Arithmetic Operators JavaScript supports the following arithmetic operators − Lets … Read more

Math Object in JavaScript

The JavaScript Math object used to perform mathematical tasks with numbers.Math is an object that has properties and methods. Math has no constructor. All Math’s properties and methods are static. To refer methods and properties use Math.propertName  and functions as Math.funcationName(). For example to access the constant pi use Math.PI To call the sine function use Math.sin(valuex), where valuex is a … Read more

Classes and Objects in JavaScript

A class is a set or category of things having some property or attribute in common i.e., car is a class having similar properties such as color, engine, gear, model number etc. The “class” construct allows us to define prototype-based classes. Syntax for declaring a class:

Objects Objects are the instance of classes i.e., … Read more

Cookies in JavaScript

What are Cookies? Normally, Cookies store user information in small text files.on your computer. A cookie is a piece of data that is stored on your browser to be accessed by your browser. Cookies are also saved as key/value pairs. Cookies will remember information about the user, when server forgets everything about the user after … Read more

HTML Document Object Model (DOM) in JavaScript

The DOM is an object-oriented representation of the website pages, which is modified with a scripting language JS. The DOM stand for Document Object Model. When a web page is loaded, the browser creates a DOM of the page. The DOM model is a tree of Objects. The DOM is a platform that allows programs and scripts to … Read more

Strict Mode in JavaScript

JAVACRIPT’s strict mode, introduced in ECMAScript 5, is a way to opt in to a restricted variant of JAVACRIPT. Strict mode is not just a subset: it intentionally has different semantics from all other normal code. Some browsers does not support strict mode. To run strict mode code with different behavior from browsers need to test for support for … Read more