We can remove duplicates from an JS array using multiple ways like set, filter and reduce JS functions. In this article, We will demonstrate the
Category: Javascript Qs
How to Justify text in pdf using jsPDF!
In this example we will show how to justify text in jsPDF. We have created an html page which can be exported to pdf on ‘Export to PDF’ button click. JSFiddle is also available
How to determine if the variable is undefined or null in Javascript?
How to determine if the variable is undefined or null in JavaScript? The easiest way is to check if the variable is
Export web page to pdf using jsPDF
sPDF is a client side Javascript PDF generator. In this example, we will show a simple example to export a web page on button click.
‘use strict’ in Javascript
‘use strict’ is literal expression which was introduced in ECMAScript 2015. Basically, when you use ‘use strict’ it tells the Browser to execute code into
Javascript Hoisting : Variable Hoisting
Hoisting is Javascript’s default behavior of moving declarations to top of the file. There are two types of Hoisting is there: Variable Hoisting Function Hoisting
How to check if JavaScript Object is empty or not/How to check if Javascript Array object is empty or not
While working with Javascript sometimes you have to check if a Javascript object/array is empty or it contains some keys/objects. To check if JavaScript Array
Difference between var and let in Javascript
Main difference between var and let is Scoping. var keyword: var declare variable and optionally initialize the variable to a value. Syntax: var declarations, wherever it
Check if element is visible or hidden in jQuery?
Check if element is visible or hidden in jQuery? The below code will help to identify if the element is visible or not:
How to add an Array of classes to an element using jQuery? Ex. Add different color to different using [array]
With jQuery 3.3.0, the .addClass(), .removeClass(), and .toggleClass() methods accept an array of classes. We will see how to add different color to n number of div elements on
Immediately-Invoked Function Expression ( IIFE )
It executes immediately after it’s created. It has nothing to do with any event-handler for any events (such as document.onload). The first pair of parentheses (function(){…}) turns the
Difference between == and === in Javascript
While conducting interview for a Front end developer perspective, It is essential to know the difference between == and === comparisons operators in Javascript. Javascript