Here is some javascript code that I have:
var screenWidth = 1280;
var screenHeight = 720;
var shapeComtainer = {
name : "bender",
offsetX : 100,
offsetY : 100,
width : screenWidth - 2*offsetX,
height : screenHeight - 2*offsetY,
};
I am getting the error offsetX and offsetY are not defined. This is in the lines where I am calculating width and height. The issue is that my width and height is dependent upon other variables inside the same object.
Is there a better/correct way to have a javascript object that represents information such as offsets and size information?