By far the best way is to write a plugin using the Javascript SDK: https://www.scirra.com/manual/15/sdk
The Browser object’s ability to execute JavaScript should be regarded as a hack and not to be used if possible – prefer the SDK – but for very short bits of code can work OK.
From r175+ you can also use c2_callFunction(“name”, [param1, param2…]) to invoke a function in the Function object.
Refer to Function object manual entry (note: it won’t be written until the next stable update though, still noting it here for future references)