Q2341. What is the output of below function calls?
**Code snippet:** ```javascript const circle = { radius: 20, diameter() { return this.radius * 2; }, perimeter: () => 2 * Math.PI * this?.radius, }; ``` ```javascript con...
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 (2,728 available).
**Code snippet:** ```javascript const circle = { radius: 20, diameter() { return this.radius * 2; }, perimeter: () => 2 * Math.PI * this?.radius, }; ``` ```javascript con...
There are 3 possible ways to achieve this in class components: 1. **Binding in Constructor:** In JavaScript classes, the methods are not bound by default. The same rule a...
The easiest approach is using regular expressions to detect and replace newlines in the string. In this case, we use replace function along with string to replace with, w...
You can use an _arrow function_ to wrap around an _event handler_ and pass parameters: ```jsx harmony this.handleClick(id)} /> ``` This is an equivalent to calling `.bind...
A _repaint_ occurs when changes are made which affect the visibility of an element, but not its layout. Examples of this include outline, visibility, or background color....
The _ref_ is used to return a reference to the element. They _should be avoided_ in most cases, however, they can be useful when you need a direct access to the DOM eleme...
Negating an array with `!` character will coerce the array into a boolean. Since Arrays are considered to be truthy So negating it will return `false`. ```javascript cons...
There are two approaches 1. This is a recently added approach. _Refs_ are created using `React.createRef()` method and attached to React elements via the `ref` attribute....
If you add two arrays together, it will convert them both to strings and concatenate them. For example, the result of adding arrays would be as below, ```javascript conso...
_Ref forwarding_ is a feature that lets some components take a _ref_ they receive, and pass it further down to a child. ```jsx harmony const ButtonElement = React.forward...
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.