Multiple choice technology programming languages

One can add custom method and properties to objects in javascript without using prototype as well.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

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.

AI explanation

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.