Contents

forProperty(_:)

Returns the value of the named property in the JavaScript object value.

Declaration

func forProperty(_ property: Any!) -> JSValue!
func forProperty(_ property: String!) -> JSValue!

Parameters

  • property:

    The name of a property in the JavaScript object.

Return Value

The value of the named property, or the JavaScript undefined value if no property exists by that name.

Discussion

Calling this method is equivalent to using the subscript operator with a string subscript in JavaScript. Use it to access fields or properties in JavaScript objects.

Topics

Related Documentation

See Also

Working with Container Values