evaluate(functionOrPredicate: "() => document.title")
Example with argument: evaluate(functionOrPredicate: "selector => document.querySelector(selector).innerText", arg: "#myElement")
Returns the JSON representation of the function’s return value.
functionOrPredicate
"() => ({ width: window.innerWidth, height: window.innerHeight })"
Example: "element => element.tagName"
(if an element is the context)
arg
JSON
scalar type represents JSON values as specified by ECMA-404.