I am trying to replicate some experiments found online in the public pavlovia repository. When I download them and sync (making some minor changes), they do not work. I realized this is because the code-components are not populated for javascript. When I try the AutoJS option, it causes a lot of errors. For example, something as simple as checking whether an item is in the key pressed list doesn’t work as key_resp.keys.includes() is undefined for JS.
I tried to write my own JS, but simple functions like
function inArray(needle,haystack)
{
var count=haystack.length;
for(var i=0;i<count;i++)
{
if(haystack[i]===needle){return true;}
}
return false;
}
don’t work because ‘length’ is not recognized.
Can anyone help with 1. determining how to maintain JS code from cloned experiments,
2. understanding what version of javascript or what modules needs to be used to circumvent the issues if making my own code.
thanks