Constructors
Last updated
Was this helpful?
Last updated
Was this helpful?
init.number
creates a new integer with a pre-defined value. By default, numeric values are bridged, so you can use ints and doubles interchangeably. However, some require a pure integer value, and using double will result in an error.
init.string
creates a new string with pre-defined value:
Note that the compiler is smart enough to know what you are asking for and in most cases, you can just omit the method altogether. The following syntax produces the same result:
init.array
creates a new, empty array that can be mutated using :
init.dictionary
creates a new, empty object that can be mutated using :