Web Development Articles

Page 324 of 801

Add number strings without using conversion library methods in JavaScript

Vivek Verma
Vivek Verma
Updated on 15-Mar-2026 322 Views

We are required to write a JavaScript program that adds two numbers represented as strings, without using any conversion library or built-in methods. For example, If the input number strings are '11' and '23', the output should be '34'. In JavaScript, a number is considered a string-represented number when the number is enclosed in single quotes ('number') or double quotes ("number"). For example: '123' or "456". If you use the typeof operator on such values, it will return the type as 'string'. Here are a few input and output scenarios that provide a better understanding of the given ...

Read More

How to print a number with commas as thousands of separators in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 8K+ Views

In this tutorial, we will look at a few ways to print a number with commas as thousands of separators in JavaScript and compare them to understand which one is suitable in a given context. Why do we do number formatting? In English, commas are used to separate numbers bigger than 999. Dot is the thousands separator in Germany. Sweden uses space. The separator is added after every three digits from the right. Let's briefly introduce the methods. Using the toLocaleString() Method Here, the built-in locale string method localizes the number format based on the country. ...

Read More

How can I store JavaScript objects in cookies?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 13K+ Views

This tutorial will teach us to store JavaScript objects into the cookies. The cookies are the information of website visitors stored in text files. There is a particular mechanism to store the cookies of users' browsers. When new visitors visit the website, the server generates the text and sends it to the user. After that, when users allow access to the web page to retrieve the cookies, the server stores all user information in the text files. Cookies store the user's search history or other information for a better experience. For example, Google stores the user's search history to ...

Read More

How can I round down a number in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

This tutorial teaches us to round down a number in JavaScript. The meaning of the round-down number is "returning the integer which is equal to or less than the current float number". For example, if we round down the number 9.99, we get 9 as an output, and in the same way, for 8.01 we get 8 as an output. In simple terms, if you represent your current number in the number line, you must return the nearest integer that resides on the left side of the current number. In this tutorial, we will take a look at ...

Read More

How to design a modern Website?

Ali
Ali
Updated on 15-Mar-2026 266 Views

Modern websites are responsive and the design works fine on multiple devices such as Desktop, Tablet, and Mobile. Also, websites these days do not follow the old font styles, many of them use Google fonts since it's easy to find a font-face matching your website's content and Google provides a lot of free fonts to choose from. Modern websites display beautifully formatted content on multiple devices such phones, tablets, and desktops. Also, nowadays Retina-ready logos help in keeping your logo amazing, no matter the resolution. Follow the below given steps and learn how to design a modern website: ...

Read More

How to add hours and minutes to a date with JavaScript?

Saurabh Jaiswal
Saurabh Jaiswal
Updated on 15-Mar-2026 12K+ Views

In this tutorial, we will learn how to add hours and minutes to a date with JavaScript. We have multiple methods to achieve this which are the following. Add hours using the setHours() Method. Add minutes using the setMinutes() Method. Add hours or minutes with the getTime() Method. Add hours using the setHours Method JavaScript date setHours() method sets the hours for a specified date according to local time. Syntax Following is the syntax to apply the setHours() method to add ...

Read More

How to play a multimedia file using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn how to play a multimedia file using JavaScript. The multimedia file is the audio and video files. The multimedia files can be of different formats. wav and mp3 are two examples of audio file formats, whereas mp4 and mkv are examples of video file formats. In HTML, multimedia files can be shown easily using different tags. We use the video tag for showing a video, and for audio, we use the audio tag. These two tags are quite similar, and many attributes are the same in both tags. The "src" attribute defines ...

Read More

How to show the number of links in a document with JavaScript?

Abhishek Kumar
Abhishek Kumar
Updated on 15-Mar-2026 886 Views

We use the links property of the document object to show the number of links in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It contains all the information about the condition of the browser as well as the web page. The links is a property of the document object that returns a list of all the hyperlinks present in the HTML document. A hyperlink may look something like this: "https://www.tutorialspoint.com/php" The links property of the document object lists all HTML ...

Read More

What are the best practices to be followed while using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 304 Views

In this tutorial, we will learn the best practices to follow while using JavaScript. JavaScript is used in almost every website to make it more user interactive. Throughout the years, ECMAScript has released different versions of JavaScript. Each version has enhanced functionalities and new features, so it is important to know the best practices to follow while using JavaScript. The following are the best practices to be followed while using JavaScript − Meaningful Variable and Function Names The variables' and functions' names should be meaningful to their uses. In JavaScript, we use the variable to store ...

Read More

What are the rules to be followed for Object Definitions in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 470 Views

In this tutorial, we will discuss the rules to follow for Object Definitions in JavaScript. JavaScript is an object-oriented scripting language. An object contains many properties. The property consists of a key and a value. The property is known as a method when this value is a function. Predefined objects are available in the browser. We can also define our objects. A real-life example of an object is a cup. The color, design, weight, and material are the main properties of a cup. The object name and the property name are case-sensitive. To define a property, we ...

Read More
Showing 3231–3240 of 8,010 articles
« Prev 1 322 323 324 325 326 801 Next »
Advertisements