如何将localhost从false更改为true?

问题描述 投票:-6回答:1
"snapMaxFileSizeKB": 1024,
    "upldr": ["upldr1", "upldr3", "upldr5", "upldrg1", "upldrg5", "cluster"],
    "localhost": false
  },
  "app": "dtube/0.7",
  "beneficiary": "dtube",
  "dmca": true,
  "pageTitleSeparator": "-",
  "appName": "DTube",
  "ipfs": "",
javascript ubuntu command
1个回答
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";
© www.soinside.com 2019 - 2024. All rights reserved.