I have declared a variable in my main html page as such:
var ColorBuffer;
I pass this variable into a function:
myFunc("example.txt", ColorBuffer);
Within this function a property of the variable is set as shown:
function myFunc(file, colBuf)
{
...
colBuf.items = 4;
}
However when I refer to 'ColorBuffer.items' within my main html page I get the error 'Cannot read property 'items' of undefined'.
So it seems that using the parameter name colBuf does not affect the argument ColorBuffer passed in...how could I set the items property of ColorBuffer from within my function?
Many thanks.