I'm trying to understand how Julia takes or operator. here is the script that I'm practicing with:
integer = 52
if length(string(integer)) == 1 || 2
println("length is 1 or 2")
end
but it gives me this error:
TypeError: non-boolean (Int64) used in boolean context
Stacktrace:
[1] top-level scope
@ In[108]:2
[2] eval
@ .\boot.jl:373 [inlined]
[3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196
and I'm sure the problem is where I wrote 1 || 2! how should I specify it in Julia? and how should I interpret TypeError: non-boolean (Int64) used in boolean context error?