Useless instructions: Difference between revisions

m
m (→‎{{header|Wren}}: Missing word in preamble.)
Line 80:
map[0:{}]
</pre>
 
=={{header|Julia}}==
In julia the function `count()` can be used to count the true values in an array.
Since in julia a `Bool` boolean is just an `Int` type, with 0 == false and 1 == true, the
Julia `sum()` function and the `count()` function are functionally identical when applied to
arrays of `Bool` type. This makes the `count()` function redundant except to better express
intent to count rather than add.
<lang julia>array = [true, true, true, false, false, true]
 
@show count(array) # count(array) = 4
@show sum(array) # sum(array) = 4
</lang>
 
 
=={{header|Wren}}==
4,102

edits