What’s the difference between “{}” and “[]” while declaring a JavaScript array?

前端 未结 7 1995
半阙折子戏
半阙折子戏 2020-12-02 10:04

What’s the difference between “{}” and “[]” while declaring a JavaScript array? Normally I declare like

var a=[];

What is the meaning of de

相关标签:
7条回答
  • 2020-12-02 10:40

    Syntax of JSON

    object = {} | { members }

    • members = pair | pair, members
    • pair = string : value

    array = [] | [ elements ]

    • elements = value | value elements

    value = string|number|object|array|true|false|null

    0 讨论(0)
提交回复
热议问题