Seeking explanation of Julia code using map! , BitVector and | operator

~ $ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> a = BitVector([0,1])
2-element BitVector:
 0
 1

julia> b = BitVector([1,0])
2-element BitVector:
 1
 0

julia> map!(|,a,b)
2-element BitVector:
 1
 0
help?> map!

  map!(function, destination, collection...)

Note the destination parameter.

1 Like