Found 8894 Articles for Front End Technology

How to invoke a function with partials appended to the arguments in JavaScript?

Naveen Singh
Updated on 14-Sep-2022 07:33:47

327 Views

In JavaScript, a function can be invoked by passing arguments to it. However, sometimes it is necessary to invoke a function with some arguments already filled in. This can be done using a technique called partial function application. What is Partial Function Application? Partial function application is a way to create a new function by "pre− filling" some of the arguments to an existing function. This is useful when you want to create a new function that is similar to an existing function, but with some arguments already set. For example, say you have a function that calculates the area ... Read More

How to call promise inside another promise in JavaScript?

Naveen Singh
Updated on 14-Sep-2022 07:32:06

5K+ Views

When working with JavaScript, you may find yourself needing to call a promise inside another promise. While this may seem like a daunting task, it is actually quite simple once you understand the basics of promises. In this article, we will discuss how to call a promise inside another promise in JavaScript. The Basics of Promises In order to understand how to call a promise inside another promise, it is important first to understand the basics of promises. A promise is an object that represents the eventual result of an asynchronous operation. Promises are used in JavaScript to handle asynchronous ... Read More

Create a Calculator using HTML, CSS, and JavaScript

Naveen Singh
Updated on 12-Jul-2024 17:53:45

48K+ Views

To create a calculator using HTML, CSS, and Javascript, we need to have basic understanding of working of HTML, CSS and JavaScript. Calculator is a simple tool which performs basic arithmetic calculations like Addition, Subtraction, Multiplication and Division. In this article, we are going to discuss how to create a Calculator using HTML, CSS, and JavaScript. Usually, if we observe any real-time calculator we know that it has: A grid of numbers (0-9 and 00). Basic arithmetic operators (+, -, /, x, %). Some symbols for ... Read More

Why JavaScript is called Richer Interface?

Manisha Patil
Updated on 24-Aug-2022 08:39:31

387 Views

There are a number of benefits to knowing JavaScript, often known as rich interface − By merging dynamic HTML elements, including HTML and JavaScript, rich user interfaces can be developed. However, because there are no interactions on the server side, the scope of such an interface is restricted to client-side activity and has very minor functional impacts. The strength of AJAX lies in its capacity to deliver even richer interfaces by enhancing their dynamic user interfaces with strong functionality through smooth server-side invocation power. Instead of requiring a full screen refresh, AJAX enables individual user interface elements to share data ... Read More

What is Undefined X1 in JavaScript

Manisha Patil
Updated on 24-Aug-2022 07:12:53

241 Views

In order to look at the outcome of Undefined X 1 in JavaScript, we first need to understand exactly Undefined in JavaScript represents. JavaScript has a keyword called undefined that has something to do with memory. The global object has the attribute undefined. In other words, it is a variable with a global scope. The primitive value of undefined is its starting value. Undefined is the type of a variable which has not been given a value. If a variable is being evaluated but doesn't have an assigned value, a method or statement will also return undefined. If a value ... Read More

How to open a webcam using JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 12:02:44

19K+ Views

In this tutorial, we will learn about the procedure to open a webcam using JavaScript. So, this can be done using WebRTC. WebRTC is a short form of Web Real-Time Communication. Using this object, we can access and capture the Webcam and Microphone devices that are available there in the user device. How to Access Webcam? We can access the user device Webcam and microphone using an ECMAScript object navigator.mediaDevices.getUserMedia(constraints). So, the getUserMedia() function by default seek user permission to use your Webcam. This function returns a promise and once you click ok and give the permission then the promise ... Read More

How to check if the value is primitive or not in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:25:01

3K+ Views

In this tutorial, we are going to know the methods to check if the given data type is primitive or not. Datatypes in JavaScript 1. Primitive 2. Non-primitive Primitive data types − String, number, undefined, boolean, null, symbols, bigint. Non-primitive data types − Object A primitive datatype/value is something that is not an object, and it is represented at the bottom level of the language implementation. All primitive values are immutable which means that you cannot change their type instead you may reassign v new value to the variable. To check if the value is primitive or not, we check ... Read More

How to create an element from a string in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:20:05

2K+ Views

In this tutorial, we will get to know about various methods to create an element from strings in JavaScript. Creating elements from a string can be very useful in case we have to generate elements dynamically which makes the website interactive. An example will be like in a to-do list app we add, delete, and edit to-do items. The createElement() Method We create JavaScript items using the createElement() method. To create a particular element, we pass the item name as a string into the createElement() method. The createElement(tagName) function has a parameter as the name of the tag which will ... Read More

How to create notes taking app using HTML, Bootstrap and JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:17:36

433 Views

In this tutorial, we will make a notes-taking app using HTML, Bootstrap, and JavaScript. So, the HTML will use here to add different-different elements, bootstrap will be working here to beautify our design like CSS, and JavaScript will be adding basic functionality like adding and deleting our notes. Let’s see our HTML design of the UI. Our UI will contain a simple text area where we will enter our desired note, a button which will use to add our given note to the list of notes and in the list of notes there will be a delete button on each ... Read More

How to create a string by joining the elements of an array in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:10:01

491 Views

In this tutorial, we will see how to create a string by joining the elements of an array in JavaScript. We will see two different approaches to doing this task. The first approach is using a simple addition operator (+) to add the elements of the array and separator. The second approach is to use the join() method. Approach 1: Using the Addition Operator (+) In this approach, we will pass two parameters to the function the array of which elements we have to Join, and the second parameter will be the separator that the user has to give, basically, ... Read More

Advertisements