Found 9053 Articles for Front End Technology

How -Infinity is converted to String in JavaScript?

Sravani Alamanda
Updated on 08-Dec-2022 09:47:04

122 Views

We all know that string is one of the primitive data types in JavaScript. JavaScript allows us to do some operations on strings like finding characters in the string, changing all characters into lowercase or into uppercase, concatenating with other strings, replacing with other strings, searching character(s) or word(s) from string, etc. We denote string in single quotations or in double quotations. typeof string variable will be a string. Syntax Syntax for String() method is, like String(value) value is required. value is JavaScript value. String() method returns a value i.e. as a string. String() method introduced ... Read More

How is NaN converted to Boolean in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 14:36:05

1K+ Views

In this article, we will learn how to convert NaN to Boolean. NaN in JavaScript means Not a Number, whose type is a Number but actually, it is not a number. To Convert, the NaN to a Boolean we use Multiple methods some of which are discussed below. Using the Boolean() Function Using the !! Operator Using the NOT Operator and isNaN() Method Using the Boolean() Function The Boolean function is used to get the Boolean value (True or False) of any variable, condition, or object. To convert the NaN into Boolean we just need to pass the ... Read More

How null is converted to Boolean in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:28:54

5K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using the Boolean function Using the !! operator Using the Boolean function The Boolean function is used to get the Boolean value (true or false) of any variable, condition, or object. To convert the null into Boolean we just need to pass the null in the Boolean function. Syntax Boolean(null) Example 1 In this example, ... Read More

How to set the inward offsets of the image border with JavaScript?

Shubham Vora
Updated on 15-Nov-2022 08:02:29

141 Views

In this tutorial, we will learn how to set the inward offsets of the image border with JavaScript. An image can be set in the border as a border image using CSS properties. The border image can be set using different parameters. To set the inward offsets of the image border, use the borderImageSlice property in JavaScript. We will see two different approaches to setting up the inward offsets of the image border with JavaScript − The borderImageSlice Property The setProperty Method Using the borderImageSlice Property The border image’s inward offsets are specified by the borderImageSlice property of ... Read More

How null is converted to String in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:47:31

14K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into String using multiple approaches which are following. Using the String() Method Concatenating null with an Empty string Using the Logical OR (||) Using Ternary Operator Using the String() Method The String() in JavaScript is used to convert a value to a String. To convert the null into a String just pass the null into this method. Here is the example ... Read More

How to return the position of the element relative to floating objects in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:32:28

339 Views

This tutorial teaches us how to return the position of the element relative to floating objects in JavaScript. To set the relative position or to get or return the relative position we are going to use the ‘clear’ property of JavaScript which is defined under the style property of an object. There are a total of four relative positions that are ‘left’, ‘right’, ‘top’, and ‘bottom’, and if we relatively position an object then it will fill all the gaps of that particular side. The float property of the JavaScript language can be used to set the property of the ... Read More

How to attach one or more drop-shadows to the box with JavaScript?

Saurabh Jaiswal
Updated on 06-Jan-2023 13:26:42

1K+ Views

To attach one or more drop shadows to a box with JavaScript, you can use the box-shadow style property. You can specify the shadow's offset, blur radius, spread radius, and color by passing values for these properties in the box-shadow property. Syntax Following is the syntax to add one or more drop shadows to the box with JavaScript − box.style.boxShadow = "offset-x offset-y blur-radius spread-radius color"; Here the box.style.boxShadow property in JavaScript allows you to add one or more drop shadows to a box element. It takes the following parameters offset-x − This is the horizontal offset of ... Read More

How null is converted to Number in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:38:34

7K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using Number() Method Using Logical OR (||) Using the ~~ operator Using Ternary Operator Concatenating null with a boolean value Using the Number() Method The Number() method in JavaScript is used to convert a value into a number. If the value is not convertible, then it will return NaN. To convert the null into ... Read More

How to set the amount by which the border image area extends beyond the border box with JavaScript?

Shubham Vora
Updated on 12-Oct-2022 11:29:02

98 Views

In this tutorial, we will learn how to set a number up by which the border image area extends beyond the border box in JavaScript. To set the amount by which the border image is extended, you need to set the border outside edges. To do this we can apply the borderImageOutset style property provided in JavaScript. After creating a border image area for the HTML element, we might have to increase the area. By knowing a method to increase the border image area more than the border box, we can make the change without writing lengthy code. ... Read More

How to return pixel depth of the screen in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:15:10

305 Views

In this tutorial, we will discuss how we can return the pixel depth of the screen in JavaScript. There is a property in JavaScript name pixel depth with the help of this property we can quickly return the pixel depth of the screen’s color. This pixel depth property returns the screen’s color depth in bits per pixel, and this property is read-only means (A property's value can be accessed, but it cannot be given a value. or we could state that it cannot be assigned to or overwritten). Basically, we are returning how many bits are used to store a ... Read More

Advertisements