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

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 any function, called this. JavaScript function while executing has a reference to its current execution any function, called this. with this keyword,It does not matter how and where function is declared … 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

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

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

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

Global in JavaScript

Global scope is a JavaScript function Scope.Scope determines the accessibility (visibility) of variables. Variables defined inside a function are not accessible (visible) from outside the function. A global variable is declared outside the function or declared with an object. It can be accessed from any function. Declaring global variable within function To declare global variables within … 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