How to check the type of a js value, such as whether it is undefined #513
-
Now it can only be converted into a string to check var some = rt.Evaluate("");
some.ToString() == "[undefined]" Can you provide an API that returns JsValue instead of just dynamic |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Well, I found that some == Undefined.Value, but other types seem to be unable to check |
Beta Was this translation helpful? Give feedback.
-
Hello @2A5F,
ClearScript doesn't have such APIs because (a) scripts can return .NET values as well as script values, and (b) ClearScript's API is designed to support languages other than JavaScript. You can use this summary to identify and interact with data returned from script code:
Good luck! |
Beta Was this translation helpful? Give feedback.
Hello @2A5F,
ClearScript doesn't have such APIs because (a) scripts can return .NET values as well as script values, and (b) ClearScript's API is designed to support languages other than JavaScript.
You can use this summary to identify and interact with data returned from script code:
undefined
is converted toUndefined.Value
.IScriptObject
.BigInt
is converted toBigInteger
.IJavaScr…