I'd like to define a javascript object in which the value of a key depends on the value of another, like so :
var params = {
width : 100,
margins : 10,
realWidth : width - margins
}
If I try this I get an error about width not being defined. Is it even possible to do that ?