- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 8894 Articles for Front End Technology
553 Views
The greatest common divisor (GCD) of two or more numbers, also known as the greatest common factor (GCF) or highest common factor (HCF), is the largest positive integer that divides a given number without a remainder. In other words, the GCD is the largest number that is a divisor of both numbers.For example, the GCD of 24 and 36 is 12.How to calculate the GCD of two numbers?There are a few different ways to calculate the GCD of two numbers, but the most common method is the Euclidean algorithm.The Euclidean algorithm is an iterative method that starts with two numbers, ... Read More
902 Views
The CSV (Comma Separated Values) file format is a popular way of exchanging data between applications and data stores. The CSV file format is simple and easy to understand, and many applications and programming languages support it.In JavaScript, there are a number of ways to convert an array of data into a CSV string. In this tutorial, we'll look at two popular methods: the Array.join() method and the JSON.stringify() method.Using the Array.join() MethodThe Array.join() method is a built-in method of the JavaScript Array object. It can be used to join the elements of an array into a single string. The ... Read More
2K+ Views
The parseInt() is a built-in function in JavaScript that parses a string and returns an integer. However, there are times when we want to convert a string into an integer without using this function. In this article, we'll explore how to do just that.Using the unary plus operatorOne way to convert a string into an integer is by using the unary plus operator. This operator converts its operand into a number. For instance, the following program converts the string "123" into the number 123 −Example 1 Examples ... Read More
6K+ Views
In this tutorial, we are going to look at how we can return true if the parent element contains the child element in JavaScript. Assuming you have two HTML elements, a parent element, and a child element, and you want to know if the parent element contains the child element.Using the Node.contains() methodThe Node interface's contains() method returns a Boolean value, indicating whether a node is a descendant of a given node or not.If you want to know if the parent element contains the child element, you can use the Node.contains() method.Here's a simple example − Some text The ... Read More
3K+ Views
In asynchronous JavaScript, there are two ways to schedule tasks – microtask queue and callback queue. Both queues are handled differently by the JavaScript engine.Microtask QueueA Microtask queue is a queue of tasks that are executed after the current task. The microtask queue is handled by the JavaScript engine before it moves on to the next task in the callback queue.ExampleHere’s an example of how microtask queue works − Examples console.log('start'); setTimeout(function() { console.log('setTimeout'); }, 0); ... Read More
369 Views
In JavaScript, there are various ways to remove elements from an array until the passed function returns true. In this tutorial, we are going to look at 3 methods in detail.Using Array.prototype.filter()The Array.prototype.filter() method can be used to remove elements from an array until the passed function returns true. Please refer to the Array filter() method for more details.Example 1The following code shows how to use this method − Examples var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; function ... Read More
89 Views
In JavaScript, an object-like value is a value that is not a primitive value and is not undefined. An object-like value is any value that is not a primitive value, including functions, arrays, and objects. There are different methods for checking if a value is objectlike in JavaScript. In this article, we are going to look at 3 methods for checking if a value is object-like in JavaScript.Using the typeof OperatorThe typeof operator is a built-in operator in JavaScript that is used to check the type of a value. The typeof operator returns a string that is the type of ... Read More
8K+ Views
In this tutorial, we will be discussing how to create a currency converter in JavaScript. We will be discussing the various steps involved in creating such a converter.What is a currency converter?A currency converter is a tool that helps you convert one currency to another. For example, if you are from the United States and you are traveling to Europe, you will need to use a currency converter to convert your US dollars into Euros.Why use JavaScript to create a currency converter?JavaScript is a versatile programming language that can be used to create a wide variety of applications, including web-based ... Read More
11K+ Views
A moving div is a web page element that can be caused to move across the screen, or change position on the screen, automatically. The position is changed by adjusting the left and top style properties. Creating a moving div using JavaScript is a relatively simple task. All that is required is a little bit of HTML, CSS, and JavaScript code. In this tutorial, we will go over how to create a moving div using JavaScript.HTML CodeThe first thing we need is some HTML code. We will create a div with an id of "movingDiv". Inside of this div, we ... Read More
11K+ Views
In JavaScript, objects can be created to store data as key-value pairs. The data in an object can be accessed using the dot notation (obj.key) or the bracket notation (obj["key"]). See the below example −let obj = { key1: "value1", key2: "value2", key3: "value" };We can remove the key-value pairs corresponding to the given keys from an object but in this tutorial, we are going to look at 3 methods.Using the delete operatorThe delete operator is used to delete a property of an object. The delete operator will not delete the variable itself, but only the value of the variable.ExampleSee ... Read More