JavaScript handler.getOwnPropertyDescriptor() Method

The handler.getOwnPropertyDescriptor() method is a trap for Object.getOwnPropertyDescriptor(). It exists as an own property of the target object and the target object is not extensible.

Syntax

Parameters

Target: The target object.

Prop: The name of the property whose description should be retrieved.

Return value

This method returns an object or undefined.

Browser Support

Chrome49
Edge12
Firefox18
Opera36

Example 1

Test it Now

Output:

Java Script is a scripting language

Example 2

Test it Now

Output:

Value : abc 10

Example 3

Test it Now

Output:

Java Script proxt : Own property 50





Latest Courses