Array.branch()

From ZCubes Wiki
Revision as of 12:26, 4 February 2020 by Joseph (talk | contribs)
Jump to navigation Jump to search

Array.branch(SomeOnlyMatches)

Split values into negative, zero and positive values. Return the true/false of the match result. Show all (with null for non-matches) or matches only based on SomeOnlyMatches.

[[1,-2],[3,3],[0,44,-44]].branch(true).print()

[ [ [false,true ],

[false,false ],

[false,false,true ] ],

[ [false,false ],

[false,false ],

[true,false,false ] ],

[ [true,false ],

[true,true ],

[false,true,false ] ] ]


[-5..5].branch(true)

true true true true true false false false false false false

false false false false false true false false false false false

false false false false false false true true true true true


[-5..5].branchvalues(true)

-5 -4 -3 -2 -1

0

1 2 3 4 5