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
Web Development Articles
Page 146 of 801
JavaScript Program for Counting sets of 1s and 0s in a binary matrix
Counting sets of 1s and 0s in a binary matrix can be achieved using nested for loops with conditional statements. A binary matrix is a matrix that consists of only two digits: 1 and 0. In this article, we will write a JavaScript program for counting the sets of 1s and 0s in a given binary matrix by counting non-empty subsets in each row and column. Understanding the Formula For any set with n elements, the total number of non-empty subsets is 2^n - 1. Let us consider a set {a, b} having 2 elements ...
Read MoreJavaScript Program for Maximum and Minimum in a Square Matrix
To get maximum and minimum in a Square Matrix in JavaScript, we will be discussing two different approaches, their complexities, and example codes. The first approach uses nested loops while the second approach uses Math functions. In this article we are having a 2D square matrix, our task is to write a JavaScript program for maximum and minimum in a square matrix. Problem Statement Input: Matrix: [ [1, 3, 7], [5, 2, 9], [2, 5, 1] ] Output: Maximum ...
Read MoreJavaScript Program to Efficiently Compute Sums of Diagonals of a Matrix
In a square matrix, there are two main diagonals: the primary diagonal (left-to-right) and the secondary diagonal (right-to-left). Computing their sums efficiently is a common programming task with practical applications in linear algebra and image processing. In this article, we will explore two JavaScript approaches to calculate diagonal sums: a brute force method using nested loops and an optimized single-loop solution. 3x3 Matrix Diagonals ...
Read MoreJavaScript Program for Diagonally Dominant Matrix
A diagonally dominant matrix is a square matrix where the absolute value of each diagonal element is greater than or equal to the sum of absolute values of all other elements in that row. In this article, we'll write a JavaScript program to check if a given matrix is diagonally dominant. This requires understanding 2D arrays, nested loops, and conditional statements. Diagonally Dominant Matrix Example ...
Read MoreJavaScript Program for Number of Local Extrema in an Array
JavaScript Program for the Number of local extrema in an array is a common problem in the field of computer science and data analysis. Local extrema are the peaks and valleys in a sequence of numbers. In this article we are having two arrays, our task is to write a Javascript program for number of local extrema in an array. Local Extrema in Array [1, 2, 3, 2, 1, 4, 5, 6, 5, 4, 3, 2, 1] ...
Read MoreHow to create a reporting app with Vue 3 and Composition API?
Vue 3 with Composition API provides a powerful way to build reporting applications. This tutorial demonstrates creating a data-driven report table that fetches information from an external API and displays it in a structured format. What is a Reporting App? A reporting app displays data in organized formats like tables, charts, or dashboards. It transforms raw data into meaningful insights for users to analyze business metrics, user statistics, or any structured information. Composition API Benefits The Composition API allows logic-based component organization instead of lifecycle-based structure. This approach creates more maintainable, reusable, and testable code by ...
Read MoreVoca: The Ultimate Javascript library for String Manipulation
Voca is a powerful JavaScript library designed specifically for string manipulation. In this tutorial, we will explore multiple examples demonstrating how to use the different functions available in Voca. Features of Voca Before we see all the examples, let's highlight some features that Voca brings to the table − It provides a multitude of functions that can be used to manipulate, query, escape, format strings. It also provides detailed and searchable documentation. It supports a wide range of environments like Node.js, Safari 7+, Chrome, ...
Read MoreHow to Create Pong Game in JavaScript?
A Pong game is a two-player paddle game where each player's task is to save the ball from hitting the wall. Whenever player 1 hits the ball at the opponent's wall then player one will receive a point, and similarly, player 2 will get a point if he/she hits the ball at the opponent's wall. In this tutorial, we will create a Pong Game in JavaScript using HTML5 Canvas. Game Controls Before implementing the game, let's understand the controls: Left Player: Use 'Z' key to move up and 'S' key to move down ...
Read MoreHow to design hit the mouse game using HTML, CSS and JavaScript?
In this tutorial, we are going to build the famous hit the mouse game using HTML, CSS, and vanilla JavaScript. Many of you wondering what is Vanilla JavaScript, it is nothing just plain JavaScript written without the use of any libraries. In the hit the mouse game, the player needs to hit the mouse with the hammer in order to earn points and win the game. Approach To design the mouse game, we need to write the code in HTML, CSS, and JavaScript. Step 1 − Firstly, let us look into the HTML part of the code; ...
Read MoreWhat are top JavaScript animation libraries?
JavaScript animation libraries offer powerful alternatives to CSS animations, providing greater flexibility and advanced features that CSS alone cannot achieve. These libraries enable developers to create complex animations, 3D graphics, particle effects, and interactive experiences with better performance and cross-browser compatibility. This article explores the top JavaScript animation libraries that can transform your web projects with stunning visual effects. Anime.js Anime.js is a lightweight animation library designed to animate HTML elements, JavaScript objects, CSS selectors, DOM attributes, and arrays. It provides complete control over targeted elements with an intuitive API. Key Features: SVG animations and ...
Read More