AmitDiwan has Published 11365 Articles

PreventDefault( ) vs Return false in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 14:59:37

2K+ Views

In this post, we will discover how to use javascript's preventDefault and return false functions to override an event's default behaviour. The two most popular JavaScript methods for stopping an event's default behaviour are preventDefault() and return false. Let’s understand both of the concepts below − preventDefault() ... Read More

Explain focus events in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 14:46:06

766 Views

The focus of items on a web page can be determined via focus events, which we will learn about in this article. The numerous browser−provided events that are triggered when an HTML element gains or loses attention are known as focus events in JavaScript. These occasions can be utilised in ... Read More

The lastIndex property in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 14:28:09

44 Views

In this tutorial, we will learn about the lastIndex property in javascript. In addition to this, we will also learn about how we can use it to manage matches within a string The lastIndex property is a property given by regex objects in JavaScript. It represents the index at which ... Read More

What are JavaScript symbols?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 14:24:58

539 Views

A symbol in JavaScript is a primitive data type, introduced in ES6 version update, that represents an immutable and unique identifier. Unlike other primitive types like strings, booleans, numbers, etc, symbols are guaranteed to be unique. This implies that even if two symbols have the same content, they are going ... Read More

Average with the Reduce Method in JavaScript

AmitDiwan

AmitDiwan

Updated on 11-Aug-2023 16:14:19

722 Views

In the given problem statement, our aim is to get the average of all the items with the help of the reduce method of Javascript. So for doing this task we will create a function and give an array as a parameter. Understanding the problem statement We ... Read More

Algorithm to add binary arrays in JavaScript

AmitDiwan

AmitDiwan

Updated on 11-Aug-2023 16:10:01

506 Views

In this problem statement, our target is to add two binary arrays with the help of Javascript. So we will break down the problem step by step to ensure understanding. What is the Binary array ? A binary array is an array that represents a binary number. In ... Read More

Java Program to Convert a String into the InputStream

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 13:04:15

1K+ Views

While displaying a long input string, we are sometimes required to process them in smaller units. At that time, converting that string into the InputStream will be helpful. To convert a given string into the InputStream, Java provides ByteArrayInputStream class that is used along with a built method named getBytes(). ... Read More

Java Program to Create Pyramid and Pattern

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 13:03:03

463 Views

If someone wants to build a strong foundation in Java programming language. Then, it is necessary to understand the working of loops. Also, solving the pyramid pattern problems is the best way to enhance the fundamentals of Java as it includes extensive use of the for and while loops. This ... Read More

Java Program to Check Whether a Number is Positive or Negative

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:53:59

612 Views

Whether the specified number is positive or negative can be defined with respect to 0. A number greater than 0 is considered a positive number whereas a number less than 0 is considered a negative number. To check whether a given number is positive or negative in Java, we can ... Read More

Java program to check palindrome

AmitDiwan

AmitDiwan

Updated on 10-Aug-2023 12:50:14

3K+ Views

The term palindrome is derived from the Greek word 'palin dromo' which means running back again. A number, string or phrase that remains the same when reversed i.e. reads the same backward as forwards is called a palindrome. For instance, numerical palindromes include numbers like 525, 2002 and 12121. And, ... Read More

Advertisements