---
title: toPoint()
framework: javascriptcore
role: symbol
role_heading: Instance Method
path: javascriptcore/jsvalue/topoint()
---

# toPoint()

Converts the value to a point structure.

## Declaration

```swift
func toPoint() -> CGPoint
```

## Return Value

Return Value A CoreGraphics point representation of the value.

## Discussion

Discussion This method treats the value as a JavaScript object, reading the values of its x and y properties using the toDouble() method and creating a CGPoint structure from the result. If the value is not a JavaScript object or does not have the appropriate properties, each of the resulting point’s coordinates is not a number (NaN).

## See Also

### Reading and Converting JavaScript Values

- [toObject()](javascriptcore/jsvalue/toobject().md)
- [toObjectOf(_:)](javascriptcore/jsvalue/toobjectof(_:).md)
- [toBool()](javascriptcore/jsvalue/tobool().md)
- [toDouble()](javascriptcore/jsvalue/todouble().md)
- [toInt32()](javascriptcore/jsvalue/toint32().md)
- [toUInt32()](javascriptcore/jsvalue/touint32().md)
- [toNumber()](javascriptcore/jsvalue/tonumber().md)
- [toString()](javascriptcore/jsvalue/tostring().md)
- [toDate()](javascriptcore/jsvalue/todate().md)
- [toArray()](javascriptcore/jsvalue/toarray().md)
- [toDictionary()](javascriptcore/jsvalue/todictionary().md)
- [toRange()](javascriptcore/jsvalue/torange().md)
- [toRect()](javascriptcore/jsvalue/torect().md)
- [toSize()](javascriptcore/jsvalue/tosize().md)
