I have this function in my head:
<head> window.onload = function(){ var x = new Array(0,2,3,4,5,6,7,8); var y = new Array(20,10,40,30,60,50,70,10); drawGraph(y,x); } </head>
Can I declare the function drawGraph() somewhere in the body? Do I need to declare it before it is called?
The order does matter. You’ll need to have the drawGraph() function declared before it’s called.