javascript - 在控制台中显示附加值

标签 javascript jquery html angularjs typescript

  • 我是 js 新手。
  • 我正在尝试在控制台中显示附加值。
  • 我不知道如何访问插件。
  • 你能告诉我如何解决这个问题吗?
  • 在下面提供我的代码。

https://jsfiddle.net/6f8upe80/

private sports: any = {
        networkNo: 241,
        startDate: "04/10/2018",
        endDate: "04/24/2018",
        addOns: [
            "sports"
        ]

    }
  //console.log("this--->" , this);
  console.log("this.sports.addOns--->" + this.sports.addOns);

最佳答案

如果您只是想找到一种方法来访问该值,您可以在本地范围内声明该变量并访问它。

let sports: any = {
    networkNo: 241,
    startDate: "04/10/2018",
    endDate: "04/24/2018",
    addOns: [
        "sports"
    ]

}
console.log("this.sports.addOns--->" + sports.addOns);

关于javascript - 在控制台中显示附加值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49806736/

相关文章:

javascript - 如何从 ember.js Controller 单击按钮

javascript - 我如何使用 html a 标签来更改 div 的宽度和高度?

javascript - 简洁的 insidehtml

html - 为什么 A HREF 标签中的 IMG 标签没有对齐的边框

html - 仅在文本中更改 UL LI 元素符号点 - Wordpress - CSS

javascript - 如何使用 "nodemon"和简单的 "node"命令运行 Express 的脚手架,而不使用 "npm start"命令?

javascript - 在 Visual Studio 11 中使用 Chrome 启用脚本调试

javascript - jQuery 查询生成器 - 无法使其工作 - 未捕获的 TypeError : Cannot set property 'extendext' of undefined

jquery - 触发点击异步 ajax done() 上的 input=file

javascript - LoDash - 按数组属性分组而不将值作为一个键