Usage of if inside arrays

This has nothing to do with any. It’s just that there’s no such thing as .&& in Julia, so it’s parsed as .& &, which later errors:

julia> Meta.parse("1 .&& 2")
:(1 .& &2)

The short-circuiting operators && and || cannot be broadcasted (you can broadcast the bitwise operator & to do element-wise “and”, but it’s not needed here).

Also, here

You’re probably trying to call the function, but you’re not. This just binds the name trophic_test2 to also refer to the same function. To call the function, you need parentheses: create_trophic_test2().