---
title: "hasProperty(_:)"
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: "javascriptcore/jsvalue/hasproperty(_:)"
---

# hasProperty(_:)

Returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.

## Declaration

```swift
func hasProperty(_ property: Any!) -> Bool
```

```swift
func hasProperty(_ property: String!) -> Bool
```

## Parameters

- `property`: The name of a property to query for in the JavaScript object value.

## Return Value

Return Value true if the JavaScript object has a defined property by that name; otherwise, false.

## See Also

### Working with Container Values

- [defineProperty(_:descriptor:)](javascriptcore/jsvalue/defineproperty(_:descriptor:).md)
- [deleteProperty(_:)](javascriptcore/jsvalue/deleteproperty(_:).md)
- [atIndex(_:)](javascriptcore/jsvalue/atindex(_:).md)
- [setValue(_:at:)](javascriptcore/jsvalue/setvalue(_:at:).md)
- [forProperty(_:)](javascriptcore/jsvalue/forproperty(_:).md)
- [setValue(_:forProperty:)](javascriptcore/jsvalue/setvalue(_:forproperty:).md)
- [JSValueProperty](javascriptcore/jsvalueproperty.md)
