Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 54 of 80

Smart / self-overwriting / lazy getters in javaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 766 Views

In this tutorial, let us discuss the smart, self-overwriting, or lazy-getters in JavaScript. A getter binds the property of an object to a function, but the getter will not calculate the property value until we access it. The getter helps when we need to get some dynamic value without an explicit call. Users can follow the syntax below to work with the getters. Syntax { get prop() {} } { get [exp]() {} } The prop and the exp are the object's properties that bind to a function. 'prop' is a simple object property, and 'exp' is an expression. ...

Read More

Set whether the table border should be collapsed into a single border or not with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 536 Views

In this tutorial, let us look at how to set whether the table border should collapse into a single table border or not with JavaScript. We can use the borderCollapse property in JavaScript to accomplish this. Let us look into this in brief. Using the Style borderCollapse Property The borderCollapse property defines whether the table border should collapse into a single table border or separate into a double table border. The value 'separate' is the default. The borderCollapse is a read-and-write property. Users can follow the syntax below to use the borderCollapse property. Syntax object.style.borderCollapse = "separate|collapse|initial|inherit|revert|unset" The syntax ...

Read More

Set whether the flexible items should wrap or not with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 219 Views

In this tutorial, let us look at the way to set whether the flexible items should wrap or not with JavaScript. We can use the flex-wrap property in JavaScript to set the item wrap value. Let us look into this in brief. Using the Style flex-wrap Property The flex-wrap property defines whether to wrap the items within a container element. The items must be flexible for the flex-wrap property to work. The default value is nowrap. Users can follow the syntax below to use the flex-wrap property. Syntax object.style.flexWrap = "nowrap|wrap|wrap-reverse|initial|inherit" The syntax above sets the flex-wrap value to ...

Read More

Set how the item will shrink relative to the rest with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 344 Views

In this tutorial, let us look at the way to set how much the item will shrink relative to the rest of the elements in JavaScript. To set item shrink relative to the rest of the elements, we can utilize JavaScript's flexShrink property. Let's take a quick look at this. Using the Styel flexShrink Property The flexShrink property specifies how much a flex item will shrink according to the other items in the same container. The element must be flexible for the flexShrink property to function. The property's value functions as a ratio. For instance, 2:3 sets 2 to the ...

Read More

How to work with document.links in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 1K+ Views

In this tutorial, let us discuss how to work with the document's link in JavaScript. The document link property is a read-only DOM level 1 feature that returns all the links. The links property gives all the anchor elements and area tags with a href attribute. Working with document.links properties Let us learn to work with a link's properties. Users can follow the syntax below to work with the link's properties. Syntax let links = document.links; links.propertyName; The above syntax returns all anchor tags, area tags, and properties. Properties length − The length is the number of elements ...

Read More

Regular expression to match numbers only in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 5K+ Views

In this tutorial, we will learn regular expressions to match numbers only in JavaScript. Data is a core element in every webpage. We have to validate it as per the requirements. We often deal with the data and require correct input from the user. For example, the user can not put the letters inside the field to accept the phone number, or the input length should be ten numbers. To validate the data in JavaScript, regular expression is used. We often need to filter the necessary data and extract the matched data. Here, we are going to match all the ...

Read More

Is there a Boolean Typed Array in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 443 Views

In this tutorial, we will learn if there is a Boolean Typed Array in JavaScript. Typed Arrays are the objects same as arrays by using we can read or write raw binary data. It is useful to carry advanced information that contains lots of data like audio or videos fast and without distortion compared to our traditional way. The machine can only understand 0s and 1s. The typed arrays saved the information in an array of binary data. So, it becomes easier to transport the data from one end to another. Now come to the question- Is there a Boolean ...

Read More

How to work with document.head in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 2K+ Views

In this tutorial, let us discuss how to work with the document's head in JavaScript. The document head property is a dom level 3 read-only feature. The document's head property returns all the head tags in the document. HTML adds an empty head tag in case it is not present. The property returns the first head element in case there are many. The head tag contains the document header information like title, keywords, description, and style sheet. Every document needs a head tag. But start and end tags are optional. The first body tag or the first frameset tag becomes ...

Read More

How to work with document.anchors in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 931 Views

In this tutorial, let us discuss how to work with the document's anchor in JavaScript. Relevant web technologies no longer recommend this property. Some browsers still recommend it for compatibility reasons. The document anchor property is a read-only feature that returns all the anchor tags. The anchor tag represents the start and end of a hyperlink. The anchor tag attributes are name, href, rel, rev, title, urn, and method. All attributes are optional. But a name attribute is mandatory for document anchors to work. Working with anchor’s properties Let us learn to work with an anchor's properties. Users can follow ...

Read More

How to work with Structs in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Nov-2022 8K+ Views

In this tutorial, let us discuss how to work with structs in JavaScript. What is a struct? A struct is the short name of the data structure. The structure creates multiple values of different types in a single variable. We can use a struct to generate records. A struct in JavaScript is the object creation. Other than that, JavaScript does not have a struct feature. Let us see the methods to create a structure. Using the String split() Method Let us learn to create a struct using string split. Separate a string with a comma and whitespace and give it ...

Read More
Showing 531–540 of 793 articles
« Prev 1 52 53 54 55 56 80 Next »
Advertisements