---
title: "setObject(_:atIndexedSubscript:)"
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: "javascriptcore/jsvalue/setobject(_:atindexedsubscript:)"
---

# setObject(_:atIndexedSubscript:)

Sets the value’s JavaScript property at the specified index, allowing subscript syntax.

## Declaration

```swift
func setObject(_ object: Any!, atIndexedSubscript index: Int)
```

## Parameters

- `object`: The value to set at the specified index.
- `index`: An index in the JavaScript object.

## Discussion

Discussion This method is equivalent to the setValue(_:at:) method, but provides Objective-C subscripting support.

## See Also

### Accessing Values with Subscript Syntax

- [objectAtIndexedSubscript(_:)](javascriptcore/jsvalue/objectatindexedsubscript(_:).md)
- [objectForKeyedSubscript(_:)](javascriptcore/jsvalue/objectforkeyedsubscript(_:).md)
- [setObject(_:forKeyedSubscript:)](javascriptcore/jsvalue/setobject(_:forkeyedsubscript:).md)
