Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Front End Technology Articles
Page 326 of 652
JavaScript Detecting a mobile browser
Detecting mobile browsers in JavaScript is essential for responsive web design and providing device-specific functionality. This can be achieved using the navigator.userAgent property to identify mobile device patterns. Basic Mobile Detection The most common approach uses regular expressions to check the user agent string for mobile device identifiers: Mobile Detection body { font-family: "Segoe ...
Read MoreHow to find duplicate values in a JavaScript array?
In this tutorial, we will discuss how we can find duplicate or repeating values in a JavaScript array using different methods or approaches to reach the solution to this problem. Below is the list of the approaches or methods we can use to solve the problem of finding duplicates − By simply Traversing the Array Using the filter() and indexOf() Methods Using the Set object and has() Method Let us discuss all of the above approaches to find duplicates in the JavaScript array − By Simply Traversing the Array Traversing the array using ...
Read MoreHow can I remove the decimal part of JavaScript number?
In this tutorial, we will learn to remove the decimal part of the number in JavaScript. While working with JavaScript, many times, developers need to play with the numbers stored in the database and needs to convert float and double numbers into the pure decimal or integer number. In this situation, developers can have multiple methods to truncate the decimal part of the number. We will see different approaches to overcome the above problem. Using the Math.trunc() method Using the Bitwise operators Using the Math.ceil() ...
Read MoreHow to sort an HTML table using JavaScript?
Sorting HTML tables using JavaScript allows for dynamic data organization without server requests. This technique uses DOM manipulation to reorder table rows based on cell content. How Table Sorting Works The sorting algorithm compares adjacent rows and swaps them if they're in the wrong order. This bubble sort approach continues until all rows are properly sorted alphabetically. Ron Shawn Caleb Compare After ...
Read MoreHow to hide a navigation menu on scroll down with CSS and JavaScript?
To hide a navigation menu on scroll down with CSS and JavaScript, you should have basic knowledge of JavaScript conditional statements and CSS. We will create the navigation menu using HTML, style it with CSS, and use JavaScript to hide the navigation menu while scrolling down. Our task is to hide the navigation menu while scrolling down and show it when scrolling up. This creates a smooth user experience by maximizing content space while keeping navigation accessible. Creating Structure of Navigation Menu Using HTML Styling the Navigation Menu Using ...
Read MoreHow to create a clickable dropdown menu with CSS and JavaScript?
To create a clickable dropdown menu with CSS and JavaScript, you can build an interactive navigation component that saves space while providing easy access to multiple options. This approach helps keep your webpage clean and organized without overwhelming users with too many visible elements. In this tutorial, we'll create a dropdown menu with a toggle button and multiple navigation links, demonstrating the complete process from HTML structure to JavaScript interactivity. Steps to Create a Clickable Dropdown Menu We will follow these three essential steps to build our dropdown menu: Structuring the ...
Read MoreRemoving an element from an Array in Javascript
Removing an element from an array in Javascript can be achieved using various approaches. Removal of an element can be done from the beginning, end or from any specific position. We will be understanding various approaches for removing elements from an array in Javascript based on our needs. In this article, we are working with an array of numbers and our task is to remove elements from an array in Javascript using different methods. ...
Read MoreHow to Add New Value to an Existing Array in JavaScript?
To add new value to an existing array in Javascript, it can be achieved using various ways. We will be understanding seven different approaches for adding a new element to existing array. In this article we are having an array of numbers and our task is to add new value to an existing array in JavaScript. Approaches to Add New Value to Existing Array Here is a list of approaches to add new value to an existing array in JavaScript which we will be discussing in this article with stepwise explanation and complete example codes. ...
Read MoreHow do you Convert a String to a Character Array in JavaScript?
Converting a string to a character array in JavaScript is useful when you want to iterate over each character or manipulate individual characters. JavaScript provides several built-in methods and techniques to accomplish this transformation. In this article, we'll explore five different approaches to convert a string to a character array in JavaScript, each with its own advantages and use cases. Approaches to Convert String to Character Array Here are the five methods we'll cover with complete examples and explanations: Using split() Method Using Array.from() Method ...
Read MoreSearching for minimum and maximum values in an Javascript Binary Search Tree
In this article, we will explain how to find the minimum and maximum values in a binary search tree (BST), with implementation in JavaScript. A binary search tree is a data structure that stores data in a sorted order such that for every node, the left subtree contains values less than the node's value, and the right subtree contains values greater than the node's value. So the leftmost node will have the minimum value, and the rightmost node will have the maximum value. Find Minimum and Maximum in a BST Given root node of a binary search ...
Read More