Object Oriented Programming Articles

Page 92 of 589

What is the use of sentry in javascript?

Ayush Gupta
Ayush Gupta
Updated on 15-Mar-2026 409 Views

Sentry is a complete JavaScript debugging and monitoring tool that helps developers track errors and performance issues in production applications. It provides real-time error tracking, performance monitoring, and detailed debugging information to improve application reliability. Key Features of Sentry Record environment and usage details to recreate and fix bugs See the error and stack trace previously only visible in user's debug console Apply source maps automatically to convert minified, compiled, or transpiled code back to its original form Mobile app reporting support ...

Read More

Jasmine.js comparing arrays

Ayush Gupta
Ayush Gupta
Updated on 15-Mar-2026 1K+ Views

In Jasmine.js, arrays can be compared in two different ways depending on your testing needs: Reference equality - checking if two variables refer to the same array object in memory Content equality - checking if arrays contain the same elements, even if they are different objects Using toBe() for Reference Equality The toBe() matcher checks whether two arrays are the exact same object in memory. This is useful when you want to verify that two variables reference the same array instance. describe("Array Reference Equality", () => { ...

Read More

JavaScript symbol.description property

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 159 Views

The symbol.description property in JavaScript returns the description string of a Symbol. Unlike Symbol.toPrimitive, the description property provides access to the optional description passed when creating a Symbol. Syntax symbol.description Return Value Returns the description string of the Symbol, or undefined if no description was provided during Symbol creation. Example: Symbol with Description Symbol Description Example Click to display symbol description... Show Description function display() { const sym1 = Symbol('user-id'); const ...

Read More

JavaScript date.@@toPrimitive() function

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 128 Views

The JavaScript @@toPrimitive method (accessed via Symbol.toPrimitive) converts a Date object into a primitive value based on the specified hint. This method is called internally during type coercion but can also be invoked explicitly. Syntax date[Symbol.toPrimitive](hint) Parameters The hint parameter specifies the preferred type of conversion: "default" - Returns string representation (same as toString()) "string" - Returns string representation "number" - Returns numeric value (milliseconds since Unix epoch) Example: Using Symbol.toPrimitive with Different Hints ...

Read More

JavaScript WebAPI File File.size Property

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 147 Views

The JavaScript File WebAPI size property returns the size of a file in bytes. This read-only property is useful for validating file sizes before upload or displaying file information to users. Syntax file.size Return Value Returns a number representing the file size in bytes. Example File Size Property body { ...

Read More

JavaScript WebAPI File File.type Property

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 164 Views

The JavaScript File WebAPI file.type property returns the MIME type of a selected file. This property is essential for validating file types and handling different media formats in web applications. Syntax file.type Return Value Returns a string representing the MIME type of the file. If the type cannot be determined, it returns an empty string. Example: Getting File Type File Type Property ...

Read More

JavaScript BOM Window Screen

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 535 Views

The JavaScript BOM (Browser Object Model) Window screen object provides detailed information about the user's display screen. This object is useful for creating responsive web applications and gathering display specifications. Screen Object Properties Property Description screen.width Returns the total screen width in pixels ...

Read More

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 toggle between password visibility with JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 264 Views

To toggle between password visibility with JavaScript, you can change the input type between "password" and "text" using a checkbox or button. This allows users to see their password when needed. How It Works The toggle functionality works by: Adding an event listener to a checkbox or button Checking the current input type Switching between "password" and "text" types Example: Using Checkbox Toggle Password Toggle Example Password Visibility Toggle ...

Read More

How to create an Autocomplete with JavaScript?

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

Creating an autocomplete feature enhances user experience by providing real-time suggestions as users type. This implementation uses vanilla JavaScript to filter and display matching results from a predefined array. HTML Structure The autocomplete requires a wrapper div with the autocomplete class and an input field: Complete Example * { box-sizing: border-box; ...

Read More
Showing 911–920 of 5,881 articles
« Prev 1 90 91 92 93 94 589 Next »
Advertisements