What do you mean keys can only be strings? And not even all strings? Wait, you mean the following will not work:
arr = [1,2,3]
regex = /a/g
x={}
x[arr] = 'array, ha!'
x[regex] = 'regex, ha!'
x['function'] = 'function, ha!'
alert(x[[1,2,3]])
alert(x[/a/g])
alert(x.function)
In javascript, you can use objects as keys and ANY string including reserved words, so long as they are wrapped in quotes.[edit] I guess technically the keys are the result of the toString function of the object used as a key so:
x = {}
x[[1,2,3]] = 'wtf'
x.toSource() === "({'1,2,3':'wtf'})"