2

It is clear why I would not want to do this. But I have little choice in the matter.

Will browsers be able to handle this?

Chrome seems to be okay with it:

> var x = {};
> x['a\nb'] = 1;
1
> x
Object
a b: 1
__proto__: Object
> Object.keys(x)
["a
b"]
Steven Lu
  • 39,229
  • 55
  • 195
  • 348

1 Answers1

3

Yes. Browsers should be able to handle that. You'll just have to use bracket notation to access that property.

Justin Niessner
  • 236,029
  • 38
  • 403
  • 530