Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Object Oriented Programming Articles
Page 92 of 589
What is the use of sentry in javascript?
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 MoreJasmine.js comparing arrays
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 MoreJavaScript symbol.description property
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 MoreJavaScript date.@@toPrimitive() function
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 MoreJavaScript WebAPI File File.size Property
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 MoreJavaScript WebAPI File File.type Property
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 MoreJavaScript BOM Window Screen
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 MoreJavaScript array.values()
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 MoreHow to toggle between password visibility with JavaScript?
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 MoreHow to create an Autocomplete with JavaScript?
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