JS function not running
Try running this program. You will get an error message, saying tools() is not a function. But if you go to the JS code, you see that tools() is a function. This also happens for the materials function. Why?
It is probably because you have also defined an array to the variable
materials. Now because programming languages are interpreted in line-order, which is interpreting line 1, then line 2, then line 3, so on. That way, in the computer's memory,
tool is a variable first. So when you name it to a function, JS gets confused. So what you can do is, rename the variable tools to
toolsVariable and the function to
toolsFunction. Do the same for materials. Your code should then work.