Articles on Trending Technologies

Technical articles with clear explanations and examples

CSS padding-bottom property

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 135 Views

The padding-bottom CSS property specifies the bottom padding of an element. It sets the space between the element's content and its bottom border. This property accepts values in length units (px, em, rem) or percentages (%). Syntax padding-bottom: length | percentage | initial | inherit; Parameters length - Fixed value in units like px, em, rem (e.g., 10px, 1.5em) percentage - Relative to the width of the containing block (e.g., 5%) initial - Sets to default value (0) inherit - Inherits ...

Read More

Using methods of array on array of JavaScript objects?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 263 Views

JavaScript array methods work seamlessly with arrays of objects. These methods allow you to manipulate, search, and transform object arrays efficiently. Basic Array Methods on Object Arrays Common array methods like push(), pop(), and splice() work directly on arrays containing objects: Array Methods on Objects body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; ...

Read More

JavaScript - Converting array of objects into object of arrays

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

In this article, we will learn to convert an array of objects into an object of arrays in JavaScript. When working with JavaScript, it's common to handle arrays of objects representing structured data. A frequent challenge is grouping these objects based on a shared property and transforming the result into a new data structure. Problem Statement The goal is to convert an array of objects into an object of arrays where the keys represent a specific property (e.g., roles) and the values are arrays of corresponding data (e.g., player names). Input const team = [ ...

Read More

Make array numbers negative JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 974 Views

In JavaScript, you can convert all positive numbers in an array to negative while keeping already negative numbers unchanged. This is useful for data transformations where you need to invert positive values. Let's say we have the following array: const arr = [7, 2, 3, 4, 5, 7, 8, 12, -12, 43, 6]; We need to write a function that converts all positive numbers to negative while leaving negative numbers unchanged (like 4 to -4, 6 to -6, but -12 stays -12). Using Array.reduce() const arr = [7, 2, 3, 4, 5, ...

Read More

Convert HTML table to array in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 5K+ Views

Converting an HTML table to an array in JavaScript involves extracting data from table cells and storing them in a structured format. This is commonly done using DOM manipulation methods or jQuery. HTML Table Structure Let's start with a sample HTML table: Name Age John 23 ...

Read More

Finding the element larger than all elements on right - JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 235 Views

We are required to write a JavaScript function that takes in an array of numbers and returns a subarray that contains all the elements from the original array that are larger than all the elements on their right. Problem Understanding For each element in the array, we need to check if it's greater than every element that comes after it. If yes, include it in the result. The last element is always included since there are no elements to its right. Algorithm Approach We can solve this efficiently by traversing the array from right to left, ...

Read More

What will happen if a semicolon is misplaced in JavaScript?

Srinivas Gorla
Srinivas Gorla
Updated on 15-Mar-2026 285 Views

If a semicolon is misplaced in JavaScript, it can lead to unexpected behavior due to Automatic Semicolon Insertion (ASI). JavaScript automatically inserts semicolons at the end of statements, which can sometimes cause logical errors when semicolons are placed incorrectly. Common Semicolon Misplacement Issues The most common problem occurs when a semicolon is accidentally placed after control flow statements like if, for, or while. Example: Semicolon After if Statement var val1 = 10; ...

Read More

How to set the width of the rule between columns with JavaScript?

Monica Mona
Monica Mona
Updated on 15-Mar-2026 166 Views

The columnRuleWidth property controls the thickness of the vertical line that appears between columns in a multi-column layout. This property works with CSS multi-column layouts created using column-count or column-width. Syntax element.style.columnRuleWidth = "value"; The value can be specified in pixels (px), ems, or keywords like thin, medium, or thick. Example #myID { column-count: 4; column-rule: 4px solid yellow; ...

Read More

How do we include the direction of text display in HTML?

Rishi Rathor
Rishi Rathor
Updated on 15-Mar-2026 279 Views

Use the dir attribute in HTML to specify the text direction. This attribute controls whether text flows left-to-right (LTR) or right-to-left (RTL). Syntax content Attribute Values Value Description Use Case ltr Left-to-right English, French, German rtl Right-to-left Arabic, Hebrew, Urdu auto Browser determines direction Mixed language content Example Here's how to use the dir attribute for different text directions: Text Direction Example This is default left-to-right text. ...

Read More

What HTML5 File.slice method actually doing?

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 321 Views

The HTML5 Blob.slice() method creates a new Blob object containing a subset of data from the source Blob. It's particularly useful for processing large files in chunks or extracting specific portions of binary data. Syntax blob.slice(start, end, contentType) Parameters The slice() method accepts three optional parameters: start - Starting byte position (default: 0) end - Ending byte position (default: blob.size) contentType - MIME type for the new blob (default: empty string) Basic Example // Create a blob with text content var originalBlob = new ...

Read More
Showing 17471–17480 of 61,297 articles
Advertisements