JSValue.CastTo<T> method
Creates a T struct from this JSValue. It throws InvalidCastException in case of failure.
C#
public T CastTo<T>()
where T : struct, IJSValue<T>| parameter | description |
|---|---|
| T | A struct that implements IJSValue interface. |
Return Value
T struct created based on this JSValue.
Exceptions
| exception | condition |
|---|---|
| InvalidCastException | Thrown when the T struct cannot be crated based on this JSValue. |
See Also
- interface IJSValue<TSelf>
- struct JSValue
- namespace Microsoft.JavaScript.NodeApi