访问 javascript 数组中具有特殊字符的格式化值

access formatted value with special character in javascript array

我收到一个对象作为对 api 调用的响应

对象如下所示

现在,当我尝试 response._modifiedby_value 时,我得到了正确的响应,但是当我尝试 response.createdby_value@OData.Community.Display.V1.FormattedValue 时,我得到了以下错误

Uncaught SyntaxError {message: "Unexpected token ILLEGAL"}

那是因为'@'是一个特殊字符,所以你不能这样做:

response.createdby_value@OData = 2;

而是

response["createdby_value@OData"] = 2;