Skip to content

Tag Archives: JavaScript-Misc

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
The 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
An item can be replaced in an array using two approaches: Method 1: Using splice() method The array type in JavaScript provides us with splice()… Read More
A prime number is a number that is divisible by 1 and itself only. First few prime numbers are: 2, 3, 5, 7, 11, 13,… 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
A JavaScript boolean represents one of two values: true or false. However, if one wants to convert a variable that stores boolean value, into integer… 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 upload 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
JavaScript uses the 24-hour format as default for DateTime. However, daytime in JavaScript can be displayed in 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 which is running on a device. The task is to find the width of the working screen device using JavaScript. Example… Read More
Ever tried to submit a form, by using a JavaScript? But when you tried to submit the form by using JavaScript, you might be getting… Read More
In JavaScript “0” is equal to false because “0” is of type string but when it tested for equality the automatic type conversion of JavaScript… Read More

Start Your Coding Journey Now!