Does JavaScript support array/list comprehensions like Python?

前端 未结 8 2154
名媛妹妹
名媛妹妹 2020-12-01 11:31

I\'m practicing/studying both JavaScript and Python. I\'m wondering if Javascript has the equivalence to this type of coding.

I\'m basically trying to get an array

8条回答
  •  Happy的楠姐
    2020-12-01 12:04

    JavaScript no longer supports array comprehensions.

    I too was looking for the JavaScript equivalent. Mozilla Developer's Network indicates that this functionality is no longer supported. The preferred syntax is referenced in the aforementioned link.

提交回复
热议问题