21.
Which of the following methods is used to define an object in JavaScript?
Object.assign()
Object.create()
Object.defineProperties()
Object.freeze()
Correct: B
The Object.create() method is used to create a new object with a specified prototype object and properties. It allows you to create an object based on an existing object and modify or add additional properties to it.