-
I got a c# string like so. var jsObject = """{ something: "hello", somethingElse: () => console.log("hello") }""" How can I use this object as an argument to a JS function? I tried var arg = JSValue.RunScript(jsObject);
var arg = JSValue.RunScript($"return {jsObject}");
var arg = JSValue.RunScript($"() => ({jsObject})"); But they all dont work. Anyone knows? |
Beta Was this translation helpful? Give feedback.
Answered by
Pentadome
Jul 25, 2025
Replies: 1 comment
-
Okay this worked. JSValue.RunScript($"({jsObject})"); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Pentadome
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Okay this worked.