JavaScript variable assignments from tuples

前端 未结 13 1378
[愿得一人]
[愿得一人] 2020-12-04 18:26

In other languages like Python 2 and Python 3, you can define and assign values to a tuple variable, and retrieve their values like this:

tuple = (\"Bob\", 2         


        
13条回答
  •  鱼传尺愫
    2020-12-04 19:16

    Unfortunately you can't use that tuple assignment syntax in (ECMA|Java)Script.

    EDIT: Someone linked to Mozilla/JS 1.7 - this wouldn't work cross-browser but if that is not required then there's your answer.

提交回复
热议问题