in
can be replaced by ∈
or =
. [note] Recall that ∈
can be written through tab completion using the command \in
. Consequently, the following constructions are all equivalent.for x in ["hello","beautiful","world"]
println(x)
end
for x ∈ ["hello","beautiful","world"]
println(x)
end
for x = ["hello","beautiful","world"]
println(x)
end
Furthermore, we can employ any character or term to describe the iteration variable. For instance, we iterate below using word
.
for word in ["hello","beautiful","world"]
println(word)
end