You can't reference a containing object in the kind of data structure you have. Likewise, in a static declaration like you have, you can't reference sibling properties either.
You can define the string at a higher level and then reference it in two places like this:
var strData = 'FOO_';
var SStorage = FOO.support({
Name: 'SStorage',
// non functions
A: {
storage: null,
ns: strData,
len: strData.length,
indicator: 'FOO_h_token'
},
One might also wonder why you are passing the length at all, when the caller can simply retrieve the length from the passed in string whenever they want to. It doesn't need to be passed separately.
What I'd actually suggest is that you eliminate the length from the data structure at all and if you want a short way to reference it, then put it in a local variable in the implementation of FOO.support()
like this:
var SStorage = FOO.support({
Name: 'SStorage',
// non functions
A: {
storage: null,
ns: 'FOO_',
indicator: 'FOO_h_token'
},
});
FOO.support = function(obj) {
var nsLen = obj.A.ns.length;
// now you have the length cached locally without requiring the caller
// to do extra work
}