Javatpoint Logo
Javatpoint Logo

JavaScript handler.has() Method

The handler.has() method used to "hide" any property you want. It's a trap for an operator. It returns the Boolean value true if you want the property to be accessed, otherwise false If the key is present or not in the original object.

Syntax

Parameters

target: The target object.

prop: The property to check for existence.

Return value

Return a Boolean value.

Browser Support

Chrome 49
Edge 12
Firefox 18
Opera 36

Example 1

Test it Now

Output:

in has true

Example 2

Test it Now

Output:

a in d: false
b in d: true

Example 3

Test it Now

Output:

called: a false

Next TopicJavaScript handler





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA