Skip to content

Tag Archives: JavaScript-Questions

Undefined comes into the picture when any variable is defined already but not has been assigned any value. Undefined is not a keyword. A function… Read More
The task is to differentiate between the indexOf() and findIndex() functions of JavaScript. we’re going to discuss both approaches. JavaScript indexOf() function: This function is… Read More
UNIX timestamps can be converted to time using 2 approaches:  Method 1: Using the toUTCString() method. As JavaScript works in milliseconds, it is necessary to… Read More
A number can be formatted to prepend a 0 to single-digit numbers using 3 approaches:  Method 1: Using padStart() method. The padStart() method is used… Read More
JavaScript parseInt() function The parseInt() function is used to parse a string and convert it to an integer of a specified radix. It takes two… Read More
Given a number and the task is to convert the number from decimal to hex. This can be done by using toString() method. It takes… Read More
There are two ways to append HTML code to a div through JavaScript Using the innerHTML attribute Using the insertAdjacentHTML() method Using the innerHTML attribute: … Read More
Given a JavaScript Object and the task is to serialize it into a URL query parameters using JavaScript.  Approach 1: Declare an object and store… Read More
In this article, we will learn how to implement file size validation by checking file size before uploading using Javascript and jQuery. This is a… Read More
Given a date in JavaScript DateTime format and the task is to convert this time into MySQL DateTime format using JavaScript.  Approach: Use date.toISOString() function… Read More
The %(modulo) operator in JavaScript gives the remainder obtained by dividing two numbers. There is a difference between the %(modulo) and the remainder operator. When… Read More
JavaScript uses the 24-hour format as the default for DateTime. However, daytime in JavaScript can be displayed at 12-hour AM/PM format using several approaches. We… Read More
Since JavaScript doesn’t provide any inbuilt functions to sort a table we will be required to use native methods to sort a given table. We… Read More
Given an HTML document that is running on a device. The task is to find the width of the working screen device using JavaScript.  Example… Read More
The reason behind this behavior is that JavaScript treats non-empty string as true. First, “0” is converted into its boolean value, by automatic type conversion… Read More

Start Your Coding Journey Now!