
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

11K+ Views
In this article, you will understand how to access the first value of an object using JavaScript. The first value of the object is the first property located at position[0] of the object. The object can be a key-value object or an array object. Example 1 In this example, let's consider a key-value pair object. const inputObject = {1: 'JavaScript', 2: 'Python', 3: 'HTML'}; console.log("A key-value pair object is defined and its values are: ", inputObject) console.log("The first value of the object is: ") const firstValue = Object.values(inputObject)[0]; console.log(firstValue); Explanation Step 1 − Define a key-value pair ... Read More

1K+ Views
In this article, you will understand how to access an object having spaces in the object’s key using JavaScript. In such cases, we use bracket notation ‘[]’ to access objects or we use dot notation(.) to access objects. Let’s see a few examples below. Example 1 In this example, let's use the bracket notation[] to access objects. console.log("The input object is a key value pair with key as firstName and value as Joseph"); const inputObject = {'firstName': 'Joseph'}; console.log("Using bracket notation to access value") console.log(inputObject['firstName']); console.log("Using bracket notation to change the value to Alice") inputObject['firstName'] = 'Alice'; ... Read More

156 Views
In this article, you will understand how many numbers in the given array are less/equal to the given value using the percentile formula. We calculate the percentage of numbers in the given array less or equal to the number using the formula − Percentile = (n/N) * 100 Where, n is the number of values below x and N is the total number of values. Example 1 In this example, we use a for-loop to iterate the array and check each element whether the value is less, equal or greater than the given input value. const calculationPercentile = ... Read More

165 Views
In this article, you will understand how ES6 (ES2015) evolved and brought new features to modern day JavaScript. ES6 stands for ECMAScript 6. It is the 6th version of ECMAScript and was created to standardize the JavaScript. The top 10 features of ES6 are: let and const keywords, Arrow Functions, Multi-line Strings, Default Parameters, Template Literals, Destructuring Assignment, Enhanced Object Literals, Promises. Example 1 In this example, let’s demonstrate the Arrow function(=>) − console.log("An Arrow function Square has been defined") square = (x) => { return x * x; } let inputValue = 6 console.log("The input ... Read More

119 Views
In this article, you will understand how Promise.any() method differs from Promise.race() method in JavaScript. The Promise.any() method in javascript is one among promise concurrency methods. It is useful when the first task needs to be completed. The Promise.race() method in javascript is one among promise concurrency methods. It is useful when the first async task need to be complete, but do not care about its eventual state (i.e. it can either succeed or fail). Example 1 In this example, let’s look at how the Promise.any() method works console.log("Defining three promise values: promise1, promise2 and promise3"); const promise1 = ... Read More

182 Views
In this article, you will understand how does Promise.all() method differs from the Promise.allSettled() method in JavaScript. The Promise.all() method takes in one or multiple promises as input and returns a single Promise. This returned promise fulfills when all of the input's promises are fulfilled. It rejects a promise when any of the input's promises is rejected, with this first rejection reason. The Promise.allSettled() method takes in one or multiple promises as input and returns a single Promise. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of ... Read More

279 Views
In this article, you will understand how internationalization works in JavaScript. Internationalization is the process of preparing software so that it can support local languages and cultural settings. It can include changing the date and time format, changing the metric system format, language format, etc. Example 1 In this example, let’s understand the changing of date and time formats. var inputDate = new Date(1990, 2, 25); console.log("The date is defined as: ") console.log(inputDate) console.log("The date in United Kingdom format is: ") console.log(new Intl.DateTimeFormat('en-GB').format(inputDate)); console.log("The date in American format is: ") console.log(new Intl.DateTimeFormat('en-US').format(inputDate)); Explanation Step 1 − Define ... Read More

6K+ Views
In this article, you will understand how inline JavaScript works with HTML. Inline JavaScript represents a code block written in between the tags in a html file. The advantage of using inline JavaScript in HTML files is to reduce the round trip of the web browser to the server. Example 1 Let us understand the how to add a basic statement a html file using inline JavaScript − This is a simple HTML file document.write("Hi, This is an inline Javascript code written ... Read More

1K+ Views
In this article, you will understand how implicit coercion differs from Explicit coercion in JavaScript. An implicit coercion is an automatic conversion of values from one datatype to another. It is also known as type conversion. An explicit coercion is the conversion of data type depending on the user's necessity. Example 1 In this example, let us learn about implicit coercion. let inputValue = "5" console.log("The input variable is defined as: ") console.log(inputValue, typeof inputValue); let resultValue = Number(inputValue); console.log("The input variable is defined as: ") console.log(resultValue, typeof resultValue); Explanation Step 1 −Define a variable: inputValue and assign ... Read More

1K+ Views
In this article, you will understand how to check if the object value exists, if not, add a new object to the array using JavaScript. In Javascript, almost every variable is an object. An object can be a string, numbers, boolean values, etc. They can also be key-value pairs. An array in javascript is a special variable that can hold more than one item. An array can be initialized using the keyword ‘const’. Example 1 In this example, we check the existence of the object using the .some() function. var inputArray = [{ id: 1, name: "JavaScript" }, ... Read More