---
title: currentThis()
framework: javascriptcore
role: symbol
role_heading: Type Method
path: javascriptcore/jscontext/currentthis()
---

# currentThis()

Returns the value of the this keyword in currently executing JavaScript code.

## Declaration

```swift
class func currentThis() -> JSValue!
```

## Return Value

Return Value The current value of the JavaScript this keyword, or nil if not within native code called from JavaScript.

## Discussion

Discussion Call this method within an Objective-C or Swift block or method invoked from within JavaScript to obtain a JSValue object representing the current value of the this keyword in that JavaScript code. If not currently in code invoked as a callback from JavaScript, this method returns nil.

## See Also

### Inspecting callback state in a running context

- [current()](javascriptcore/jscontext/current().md)
- [currentCallee()](javascriptcore/jscontext/currentcallee().md)
- [currentArguments()](javascriptcore/jscontext/currentarguments().md)
