Node.js · Senior · Question 6 of 75
What are hidden classes (shapes) in V8, and why do they matter?
- 1TypeScript types that V8 reads at runtime
- 2Private class fields marked with
# - ✓Correct answer: Internal descriptions of an object's layout; objects with the same shape let V8 use fast inline caches for property access
Explanation
Creating objects with the same properties in the same order keeps them on one shape. Adding properties in different orders or using delete can make hot code polymorphic and slower.