In Geogebra let's define a JavaScript global function from a button (property):
function ggbOnInit() {
}
function test(par) {
return par * math.random();
}
How do I call that function from a Geogebra script attached to that button ("on click" property)?
The following Geogebra script:
Sequence[test(3),k,1,5]
launches an error message " unknown command test", whereas a sequence of five random numbers between 0 and 3 were waited.