Frage

Suppose I have a JSON property starting with #, for example:

var person = { "#name": "superman" };

How do I refer to it in my JS code? person.#name is not working in my editor (webstorm)?

It is supposed to be valid JSON.

War es hilfreich?

Lösung

Bracket notation?

var name = person["#name"];

There is more information on this thread.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top