What do you call this JavaScript syntax, so I can research it?

前端 未结 7 632
一向
一向 2020-12-18 00:57

1) In the following code, what is the reasoning behind making gameOfLive a variable and not just function gameOfLife()?

2) What is go

7条回答
  •  悲&欢浪女
    2020-12-18 01:32

    According to this page, declaring gameOfLife in their way is no different from declaring it your way. The way they define gol makes it an object (or you can think of it as an associative array). A similar shortcut for arrays is to use square brackets instead of curly braces.

提交回复
热议问题