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
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to install yup in react native in JavaScript?
Yup is a popular JavaScript schema validation library that integrates seamlessly with React Native applications. It provides a simple and powerful way to validate form data by defining validation schemas with various rules for different field types. Installation Install Yup in your React Native project using npm or yarn: npm install yup Or using Yarn: yarn add yup Basic Syntax Create validation schemas using Yup's chainable API: import * as Yup from 'yup'; const schema = Yup.object().shape({ fieldName: Yup.string().required("This field is required"), ...
Read MoreJavaScript Program to Find Longest Common Prefix Using Word by Word Matching
Prefixes are substrings that start from the zeroth index of a string and can be of any size from 1 to the complete length of the string. We are given a set of strings and need to find the longest common prefix among all of them using JavaScript. We'll implement word-by-word matching approach where we compare characters at the same position across all strings. Input arr = ["zefkefgh", "zefkdefij", "zeffdzy", "zefkdabacd"]; Output zef Explanation From all the given strings, the first three ...
Read MoreJavascript Program to Check if two numbers are bit rotations of each other or not
Problem Statement − We have given two integer numbers and need to check whether the two numbers are bit rotations of each other. In JavaScript, every integer is a 32-bit binary number which is a representation of 0 and 1. Here, we need to check if we rotate the 32-bit string of the first number; we can achieve the 32-bit string of the second number or not out of a total of 32 rotations of the first number. What are Bit Rotations? Bit rotation means moving bits from one end to another. For example, if we rotate ...
Read MoreDetect Whether a Device is iOS or Not Using JavaScript
JavaScript is a high-level, interpreted programming language that is widely used for developing dynamic and interactive web applications. Its versatility and ease of use have made it one of the most popular programming languages in the world. In this tutorial, we'll explore how to use JavaScript to detect whether a device is running iOS or not. Knowing the type of device your users are accessing your web application from is crucial as a software developer. This information can be used to provide a better user experience or to customize the layout and functionality of your web application. In this ...
Read MoreBuilding Cross-Platform Desktop Applications with NW.js and JavaScript
In today's digital era, there is an increasing demand for cross-platform desktop applications that can run seamlessly on multiple operating systems. One powerful solution for developing such applications is NW.js (previously known as Node-Webkit). NW.js allows developers to build desktop applications using familiar web technologies such as JavaScript, HTML, and CSS. This article will delve into the world of NW.js and explore how JavaScript can be leveraged to create cross-platform desktop applications. What is NW.js? NW.js is essentially a combination of Chromium (the open-source project behind Google Chrome) and Node.js. This powerful duo enables developers to utilise the ...
Read MoreText to Voice conversion using Web Speech API of Google Chrome
Nowadays, audiobooks are more preferred by readers over traditional books as they can absorb knowledge while multitasking. Many websites also include audio versions of articles, allowing users to listen instead of reading. To convert text to speech, we use the Web Speech API available in modern browsers. In this tutorial, we will learn how to use the Web Speech API to convert text to voice with practical examples. Syntax Users can follow the syntax below to use the Web Speech API for text-to-speech conversion. var synth = window.speechSynthesis; var speechObj = new SpeechSynthesisUtterance(text); synth.speak(speechObj); ...
Read MoreDetect the Operating System of User using JavaScript
JavaScript can detect a user's operating system to provide customized experiences, different interfaces, or platform-specific features. This capability is particularly useful for web applications that need to adapt their behavior based on the user's platform. In this tutorial, we'll explore two primary methods for detecting the operating system using JavaScript: The navigator.platform property The navigator.userAgent property Each method has its strengths and limitations. We'll examine both approaches with practical examples to help you choose the best solution for your needs. Using navigator.platform Property The navigator.platform property returns a string identifying the platform on ...
Read MoreBuilding Cross-Platform Mobile Games with JavaScript and Phaser.js
The mobile gaming industry has experienced exponential growth over the years, with millions of users enjoying games on their smartphones and tablets. Developing cross-platform mobile games can be a daunting task due to the various operating systems and device specifications. However, JavaScript, combined with the Phaser.js framework, provides a powerful solution for creating captivating and responsive games that can run seamlessly across multiple platforms. In this article, we will explore the fundamentals of building cross-platform mobile games using JavaScript and Phaser.js, providing code examples, explanations, and a conclusion. Getting Started with Phaser.js Phaser.js is a fast, open-source game ...
Read MoreHow to Send Axios Delete to the Backend ReactJS in JavaScript
Sending DELETE requests to a backend is a common requirement in React applications. Axios provides multiple ways to handle DELETE operations, making it easy to remove data from your server. What is Axios DELETE? Axios DELETE is an HTTP method used to remove resources from a server. In React applications, you'll typically use it to delete user records, posts, comments, or any other data that needs to be removed from your backend database. Algorithm Here are the steps to send an Axios DELETE request in React: Import Axios − Include the Axios library in ...
Read MoreCreating a Progress Bar using JavaScript
JavaScript is a powerful language that allows web developers to create dynamic and interactive web pages. One of the most useful features that JavaScript can be used for is creating a progress bar. In this tutorial, we will walk you through the process of creating a progress bar using JavaScript. A progress bar is a graphical representation of the progress of a task, and can be used to give the user feedback on how long a task will take to complete. We will use JavaScript to update the progress bar as the task progresses, giving the user a visual ...
Read More