This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
entwine:understanding_grunt [2016/05/19 22:09] klembot created |
entwine:understanding_grunt [2017/10/09 20:39] (current) |
||
---|---|---|---|
Line 31: | Line 31: | ||
Square brackets surround an array, and commas separate the values. You can mix different kinds of values in an array. ''['Africa', 16]'' is perfectly fine to write. | Square brackets surround an array, and commas separate the values. You can mix different kinds of values in an array. ''['Africa', 16]'' is perfectly fine to write. | ||
- | Fourth, JavaScript has //objects//. Objects are like arrays, except instead of being in a sequence, they're more like table. | + | Fourth, JavaScript has //objects//. Objects are like arrays, except instead of being in a sequence, they're more like a table. |
<code javascript> | <code javascript> | ||
Line 60: | Line 60: | ||
Notice how you're also allowed to spread out a definition of both arrays and objects across multiple lines. It's a good idea to indent these definitions so you can make sure that you keep the number of {s and }s equal. | Notice how you're also allowed to spread out a definition of both arrays and objects across multiple lines. It's a good idea to indent these definitions so you can make sure that you keep the number of {s and }s equal. | ||
- | Fifth, JavaScript lets you add //comments// so you can leave notes for yourself as to how things work. They come in two forms: | + | Fifth, JavaScript lets you add //comments// so you can leave notes for yourself as to how things work. Anything inside a comment is ignored when the code is run. Comments come in two forms: |
<code javascript> | <code javascript> |