What is the type of “keys” in JavaScript?

前端 未结 5 424
梦毁少年i
梦毁少年i 2020-12-05 17:52

I bumbed into one of those moments when I just lose the focus and start wondering on a silly question:

var a = {
  b: \"value\"
}

What is t

5条回答
  •  北海茫月
    2020-12-05 18:47

    b is a string, it's just a shorthand syntax, so you write

    var a = {
        b: "value"
    }
    

    instead of

    var a = {
      "b": "value"
    }
    

提交回复
热议问题