
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10483 Articles for Web Development

1K+ Views
This tutorial will teach us to convert the string into the lower case. Programmers can ask themselves why they need to convert the string in the lower case? Let’s understand the answer using the single example. Suppose you are developing the application and need to take input from the user using the form or either way. Users can type the text in upper case, lower case, or a mix of both. Also, you have stored some values in the lower case in your database, and you need to match them with the user input. If you match the input string ... Read More

2K+ Views
This tutorial will teach us to convert the string into the upper case. In many governments, websites users have seen while filling forms, characters are automatically converted into the upper case to avoid any mistakes. It needs to do because JavaScript is a case-sensitive language, and if the user adds some characters in lower case and some in upper case, it can mismatch with the string stored in the database. To get accurate data from the user, it is needful to convert the string to uppercase. Here, we will learn the different methods to convert the string into the upper ... Read More

426 Views
The examples given above have the same output, but yes the method differs, with that the parameters too.The substring() method the second parameter is the index to stop the search, whereas the second parameter of substr() is the maximum length to return.ExampleLet’s see an example for substr() method in JavaScript −Live Demo JavaScript String substr() Method var str = "Apples are round, and apples are juicy."; document.write("(1, 2): " + str.substr(1, 2)); document.write("(-2, 2): ... Read More

577 Views
In this tutorial, we will learn how to get the last index of an occurrence of the specified value in a string in JavaScript. The last index of an occurrence means the last position found of the searched item in a given string. It can be a single character or a word also. To find the index of the last occurrence, we have a method in JavaScript that is the lastIndexOf() method. Using the lastIndexOf() Method This method will search the whole string and return the index of that value's last position. If it doesn’t find the item, it ... Read More

4K+ Views
In this tutorial, we will learn how to initialize a boolean array in JavaScript. We can initialize a boolean array in JavaScript in three ways− Using the fill() Method Using the Array from() Method Using the for Loop Using the fill() Method We can initialize a boolean array using the fill() method. The fill() method sets the static value of all array elements from the beginning index to the end index. Syntax //initialization of boolean array with fill() method let arrayName = new Array(array_length).fill(true/false); In the above syntax, we create an array with the name "arrayName" ... Read More

29K+ Views
In this tutorial, we will learn to check if the variable is a Boolean in JavaScript. In JavaScript, if we match the two different variables with the same value and different data types using the equality operator, it returns a true value. It means if we compare a twovariable with the true value but different data types such as Boolean and string, it will generate a positive result. To overcome these problems, we need to check if the variable is of type Boolean or not before matching it with other values. Users can use the three methods below to check ... Read More

2K+ Views
To declare a Boolean in JavaScript, you need to assign true or false value.var answer = true;ExampleTo learn about the working of Boolean, let’s see the following example −Live Demo JavaScript Boolean var num1 = 10; var num2 = 20; document.write(num1 > num2);

1K+ Views
We have given a number and the task is to calculate the nth root of that number using JavaScript. We have multiple ways to achieve this, some of which are the following. Using Math.pow() Method Using Logarithm To get the nth root of a number firstly let’s understand whose root we can calculate and which number’s root we cannot calculate. If the number is positive and the root is also even then we will get two solutions. E.g − 2nd root of 16 is +4 and -4, similarly 4th root of 16 is +2 and -2 If ... Read More

26K+ Views
In this tutorial, we will learn to check whether a value is a number in JavaScript. In JavaScript, it is necessary to check the variable's data type while performing some operation. Otherwise, it can create some unknown bugs in your application. For example, when users use the addition operator with the string, it concatenates the two strings, and in the same way, if users use the addition operator with a number, it adds two numbers. Now, think that the user wants to add two numbers but is concatenating the two strings. Here, we have three different methods to check whether ... Read More

32K+ Views
In this tutorial, we will learn to round a number to a one decimal place in JavaScript. There are various needs to round the float numbers and show particular digits after the decimal point. In our case, we need to show only the digit after the decimal point. However, we will create a customizable manual function that can round off the number and show the particular number of digits after the decimal point at the end of this tutorial. This example lets users understand the fundamental need to round a number to a single decimal digit. Suppose the scenario where ... Read More