A list literal is a listing of expressions.
Lists are always ordered and can contain different types of objects, such as strings, integers, booleans, etc. Lists are a mutable data type and therefore a good choice for dynamic data (adding and subtracting to lists).
In Emojicode, a list is created by using 🍿 and 🍆.
For instance, the example below is a list literal with integer values
🍿 18 67 420 🍆
Here’s another list with three strings:
🍿 🔤eggs🔤 🔤blueberries🔤 🔤cookies🔤 🍆
The compiler will try to infer the type of a list literal. The default type of list literals, is the list type 🍨, an ordered mutable collections of values.
- Anonymous contributors
Learn Emojicode on Codecademy
- Anonymous contributorsAnonymous contributors