Articles on Trending Technologies

Technical articles with clear explanations and examples

Dictionary Data Structure in Javascript

Samual Sam
Samual Sam
Updated on 15-Mar-2026 2K+ Views

In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection. Note that a dictionary is also known as a map. The dictionary problem is a classic computer science problem: the task of designing a data structure that maintains a set of data during 'search', 'delete', and 'insert' operations. There are many different types of implementations of dictionaries. Hash Table implementation Tree-Based Implementation (Self-balancing ...

Read More

How to create tabs with CSS and JavaScript?

Aman Kumar
Aman Kumar
Updated on 15-Mar-2026 6K+ Views

In this article, we are going to discuss how to create tabs with CSS and JavaScript. Tabs are containers whose main purpose is to show and navigate through the diverse content of the website. Tabs are commonly used to manage the space and make the website more user-friendly without reloading too many times. The content in these tabs are usually closely related but mutually exclusive. There are several types of tabs which can be created and used in various cases: Horizontal tabs Horizontal with Secondary Tabs Frameless ...

Read More

JavaScript Error message Property

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 275 Views

The message property of JavaScript Error objects contains a human-readable description of the error. It's automatically set when an error occurs and can also be customized when creating custom errors. Syntax error.message Example: Accessing Error Message JavaScript Error message Property body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .sample { font-size: 18px; ...

Read More

How to create a draggable HTML element with JavaScript and CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 751 Views

To create a draggable HTML element with JavaScript and CSS, you need to handle mouse events and update the element's position dynamically. This technique allows users to click and drag elements around the page. Basic HTML Structure Start with an HTML element that has absolute positioning and a move cursor to indicate it's draggable: body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .dragDiv { position: absolute; ...

Read More

Adding default search text to search box in HTML with JavaScript?

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

A default search text is a text that provides suggestions or a hint of what to search for in the search (input) box. Following is an illustration of a search box, where you can observe a default search text "Search your favorite tutorials…": Search your favorite tutorials... The above default search text will suggest to visitors that they can search for their favorite tutorial, which they want to read or open on the website. HTML placeholder Attribute In HTML, the text that appears inside a ...

Read More

How to de-structure an imported object in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 223 Views

Destructuring allows you to extract specific properties from imported objects in JavaScript modules. This is particularly useful when you only need certain properties from a larger object. Basic Destructuring Syntax When importing an object, you can destructure it immediately or after import: // Method 1: Destructure after import import person from "./sample.js"; let {firstName, lastName, age} = person; // Method 2: Direct destructuring (named exports) import {firstName, lastName, age} from "./sample.js"; Example: Complete Implementation sample.js (Module file) export default { firstName: 'Rohan', ...

Read More

JavaScript Narcissistic number

Alshifa Hasnain
Alshifa Hasnain
Updated on 15-Mar-2026 947 Views

In this article, we will learn to check if a number is Narcissistic in JavaScript. A Narcissistic number is a number that equals the sum of its digits, each raised to the power of the total number of digits. We will explore two approaches to solve this problem: an iterative method and a concise string manipulation technique. What is a Narcissistic Number? A narcissistic number (also known as an Armstrong number) in a given number base is a number that equals the sum of its digits each raised to the power of the number of digits. For ...

Read More

Display the Asian and American Date Time with Date Object in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 2K+ Views

JavaScript's Date object provides powerful timezone handling through the toLocaleString() method. You can display dates and times for different regions by specifying timezone identifiers. Syntax new Date().toLocaleString("en-US", {timeZone: "timezone_identifier"}); Parameters locale: Language and region format (e.g., "en-US", "en-GB") timeZone: IANA timezone identifier (e.g., "Asia/Kolkata", "America/New_York") Asian Time Zone Example // Display current time in Asian timezone (India) var asianDateTime = new Date().toLocaleString("en-US", { timeZone: "Asia/Kolkata" }); console.log("Asian Date Time (India):"); console.log(asianDateTime); // Convert to Date object for further processing var asianDateObject = new ...

Read More

How to create a zero-filled JavaScript array?

Ramu Prasad
Ramu Prasad
Updated on 15-Mar-2026 209 Views

To create a zero-filled JavaScript array, you have several methods available. The most common approaches include using Array.fill(), Array.from(), or typed arrays like Uint8Array. Using Array.fill() Method The Array.fill() method is the most straightforward way to create a zero-filled array: // Create array of length 5 filled with zeros var zeroArray = new Array(5).fill(0); document.write("Zero-filled array: " ...

Read More

What is nodeValue property in JavaScript HTML DOM?

Vikyath Ram
Vikyath Ram
Updated on 15-Mar-2026 352 Views

The nodeValue property in JavaScript HTML DOM returns the value of a node. It returns null for element nodes and the actual content for text nodes. Syntax node.nodeValue Return Value The nodeValue property returns: Text nodes: The text content Comment nodes: The comment text Element nodes: null Attribute nodes: The attribute value Example: Getting Text Node Value You can try to run the following code to learn how to get nodeValue property. ...

Read More
Showing 17951–17960 of 61,297 articles
Advertisements