# TypeError: non-boolean (BitArray{1}) used in boolean context

**URL:** <https://discourse.julialang.org/t/typeerror-non-boolean-bitarray-1-used-in-boolean-context/25810>\
**Category:** New to Julia\
**Created:** [June 28, 2019, 2:29pm UTC](https://discourse.julialang.org/t/typeerror-non-boolean-bitarray-1-used-in-boolean-context/25810 "2019-06-28T14:29:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 28, 2019, 2:31pm UTC](https://discourse.julialang.org/t/typeerror-non-boolean-bitarray-1-used-in-boolean-context/25810/2 "2019-06-28T14:31:53Z")

</div>

This is exactly the same as the answer in [MethodError: no method matching -(::Int64, ::Array{Float64,1}) - #3 by aaron](https://discourse.julialang.org/t/methoderror-no-method-matching-int64-array-float64-1/25806/3).

`ifelse` works on scalars so if you want to do it elementwise use the dot syntax, `ifelse.(...)`.

---

_[View the full topic](https://discourse.julialang.org/t/typeerror-non-boolean-bitarray-1-used-in-boolean-context/25810)._
