如何将localhost从false更改为true?

时间:2018-08-07 22:18:22

标签: javascript ubuntu command

"snapMaxFileSizeKB": 1024,
    "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
    "localhost": false
  },
  "app": "dtube/0.7",
  "beneficiary": "dtube",
  "dmca": true,
  "pageTitleSeparator": "-",
  "appName": "DTube",
  "ipfs": "",

1 个答案:

答案 0 :(得分:0)

您的数据已损坏。我必须通过添加一些结构来重新创建数据来制作工作样本。在JavaScript中,您的数据将如下所示。

var someVariable = {
  "server":{
    "snapMaxFileSizeKB": 1024,
    "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
    "localhost": false
  },
  "app": "dtube/0.7",
  "beneficiary": "dtube",
  "dmca": true,
  "pageTitleSeparator": "-",
  "appName": "DTube",
  "ipfs": "",

};

这是一个基本对象。要访问对象,请尝试

console.log(someVariable.server.localhost);

或尝试

console.log(someVariable["server"]["localhost"]);

设置值时尝试:

someVariable.server.localhost = "some value";
someVariable["server"]["localhost"] = "some other value";