One can add custom method and properties to objects in javascript without using prototype as well.
Reveal answer
Fill a bubble to check yourself
One can add custom method and properties to objects in javascript without using prototype as well.
True
False
JavaScript allows adding custom methods and properties to objects directly without using prototype. You can add properties to individual object instances (obj.customProp = 'value') or to constructor functions (Constructor.customMethod = function(){}). Prototype is used for inheritance shared across instances, but direct addition is also valid.
The statement is True. In JavaScript you can add custom properties and methods directly onto an object instance (e.g. obj.greet = function() {...}) without ever touching its prototype chain. Using the prototype is only necessary when you want the method shared across all instances of a constructor; direct assignment on an instance works fine independently of prototypes.