Help about javascript

In starting there is use of drawBox() function .

I don’t have much knowledge about javascript but when I tried to use that function in different code editor that simply gave error .

Is this a function that is predefined in the app database that we are using or I’m using it in wrong way in other editors ???