Front End Technology Articles

Page 399 of 652

JavaScript array.values()

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 212 Views

The array.values() method returns an iterator object that contains all the values of an array. This method provides a way to iterate through array values using for...of loops or iterator methods. Syntax array.values() Parameters This method takes no parameters. Return Value Returns an Array Iterator object containing the values of the array. Example: Using array.values() with for...of Loop Array Values Example JavaScript array.values() ...

Read More

How to trigger a button click on keyboard "enter" with JavaScript?

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

To trigger a button click when the user presses the "Enter" key, you can use JavaScript's event listeners to detect the keypress and programmatically trigger the button's click event. Basic Example Here's a complete example that triggers a button click when Enter is pressed inside an input field: Trigger Button Click on Enter Trigger Button Click on Enter Example Click ...

Read More

How to sort an HTML list using JavaScript?

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

Sorting an HTML list with JavaScript involves manipulating the DOM elements to reorder list items based on their content. Here are two effective approaches to accomplish this. Method 1: Using Array Methods (Recommended) This modern approach converts list items to an array, sorts them, and rebuilds the list: Sort HTML List Animal List Sorting Sort Alphabetically Zebra Elephant ...

Read More

JavaScript DataView()

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 241 Views

The JavaScript DataView provides a low-level interface for reading and writing multiple number types in binary ArrayBuffer. You cannot manipulate ArrayBuffer directly without using DataView(). Syntax new DataView(buffer) new DataView(buffer, byteOffset) new DataView(buffer, byteOffset, byteLength) Parameters buffer - The ArrayBuffer to create a view for byteOffset - (Optional) Starting byte offset, default is 0 byteLength - (Optional) Number of bytes to include, default is buffer's length Basic Example DataView Example Run ...

Read More

How to remove a class name from an element with JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 488 Views

To remove a class name from an element with JavaScript, you can use the classList.remove() method. This method provides a clean and efficient way to manipulate CSS classes dynamically. Syntax element.classList.remove('className'); Example .newStyle { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; width: 100%; padding: 25px; background-color: rgb(147, 80, 255); color: white; ...

Read More

How to create animations using JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 364 Views

JavaScript animations are created by repeatedly changing CSS properties over time using functions like setInterval() or requestAnimationFrame(). This allows you to create smooth visual effects directly in the browser. Basic Animation Principles JavaScript animations work by: Selecting the element to animate Using a timer function to repeatedly update CSS properties Incrementing position, size, or other properties each frame Stopping the animation when the target is reached Example: Moving and Morphing Animation ...

Read More

State differences between Data Driven and Keyword Driven Framework.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 15-Mar-2026 1K+ Views

Data Driven and Keyword Driven frameworks are two popular approaches in test automation. Understanding their differences helps choose the right framework for your testing needs. Data Driven Framework In data driven testing, we run tests on multiple data sets using parameterization. The data acts as input to the test script logic, with each data set representing a separate test case. The framework revolves around data maintained in external files (Excel, CSV, JSON) which is updated for individual test cases without changing the core test script logic. Example: Data Driven Login Test // Sample data ...

Read More

Explain Behavior Driven Framework.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 15-Mar-2026 391 Views

Behavior Driven Development (BDD) is a software development framework that brings together all project stakeholders including developers, testers, product owners, managers, customers, and business analysts. The main goal is to ensure everyone shares the same understanding of the application's requirements and behavior. BDD emphasizes collaboration and coordination among team members by describing functional requirements in plain, non-technical language that everyone can understand. This eliminates the need for deep technical coding knowledge when discussing specifications. How BDD Works The BDD process follows a structured approach that focuses on the application's behavior rather than its technical implementation: ...

Read More

NaN and Infinity example in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 271 Views

In JavaScript, NaN (Not-a-Number) and Infinity are special numeric values that represent invalid or infinite calculations. Understanding these values is crucial for handling mathematical operations and validation. What is NaN? NaN represents a value that is "Not-a-Number". It occurs when a mathematical operation fails or produces an undefined result. NaN Examples let results = document.getElementById('nanResults'); ...

Read More

How to search for a string in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 317 Views

JavaScript provides several methods to search for strings. The most common approaches are search(), indexOf(), includes(), and match(). Using search() Method The search() method returns the index of the first match or -1 if not found. It supports regular expressions. String Search Example The spring season is about to come. SEARCH FOR 'spring' ...

Read More
Showing 3981–3990 of 6,519 articles
« Prev 1 397 398 399 400 401 652 Next »
Advertisements