문제

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.

도움이 되었습니까?

해결책

Bracket notation?

var name = person["#name"];

There is more information on this thread.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top