Creating an empty array

Now let's create a few arrays in Playgrounds.

Sometimes, you may want to remove your prior entries from your Playground so that it is easier for you to see each new print statement. Do that now and input the following:

We just created our first two arrays. The reason for two different syntaxes is because you can create it in two different ways. Regarding the first example, you will see me create arrays throughout this book.

The data types within each set of brackets tells Swift what type of array we want to create. The first array (integers) we created has a data type of ints, and our second array (strings) has a data type of strings.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.185.180