properties - Function with a property in javascript? -
i have object parameter
, has property value
. thusly defined
var parameter = { value : function() { //do stuff } };
my problem that, in cases, value needs have property of own named length
can that? seems putting this.length = foo
not work, neither parameter.value.length = foo
after object declaration.
the problem seems selection of word 'length'. in javascript, functions objects , can have properties. functions have length property returns number of parameters function declared with. code works:
var parameter = { value : function() { //do stuff } }; parameter.value.otherlength = 3; alert(parameter.value.otherlength);
Comments
Post a Comment