True Ones, False Zeros

Published by Deep Xavier in

Create a function that returns a converted array of boolean values from a given bit string. Basically, a bit character 1 is true, otherwise, it's false.

Examples

integerBoolean("0110") ➞ [false, true, true, false]

integerBoolean("100101") ➞ [true, false, false, true, false, true]

integerBoolean("10") ➞ [true, false]

integerBoolean("001") ➞ [false, false, true]

Notes

Characters in the given bit string are absolutely 1's and 0's only.

Watch a quick demo on how Edabit works.