Q761. What is the purpose of Symbol.iterator and how do you use it?
`Symbol.iterator` is a well-known symbol that specifies the default iterator for an object, making it iterable with `for...of` loops and spread operators. ```javascript /...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (780 available).
`Symbol.iterator` is a well-known symbol that specifies the default iterator for an object, making it iterable with `for...of` loops and spread operators. ```javascript /...
The Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or the viewport. **Basic u...
Async iterators allow you to iterate over asynchronous data sources using `for await...of` loops, where each iteration can wait for a Promise to resolve. **Regular iterat...
`Object.getOwnPropertyDescriptors()` returns all own property descriptors of an object, including their attributes (value, writable, enumerable, configurable, get, set). ...
`Promise.allSettled()` and `Promise.all()` both handle multiple promises, but they behave differently when promises are rejected. **Promise.all() - fails fast:** ```javas...
Try-catch blocks have performance implications, especially when used in hot code paths or when exceptions are frequently thrown. **Performance impact:** ```javascript // ...
The AbortController API provides a way to abort one or more asynchronous operations, particularly useful for canceling fetch requests. **Basic usage:** ```javascript cons...
Custom error classes allow you to create specific error types with additional properties and methods, making error handling more precise. **Basic custom error:** ```javas...
Synchronous and asynchronous generators differ in how they produce values and handle asynchronous operations. **Synchronous generator:** ```javascript function* syncGener...
Proxy traps are handler methods that intercept fundamental operations on objects, allowing you to customize their behavior. **Available traps:** ```javascript const handl...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.