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
  • 41,389
  • 58
  • 210
  • 364

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
  • 242,243
  • 40
  • 408
  • 536