Bryan Anderson
02/02/2022, 8:28 PMbdw429s
02/02/2022, 8:34 PMbdw429s
02/02/2022, 8:34 PMbdw429s
02/02/2022, 8:34 PMbdw429s
02/02/2022, 8:35 PMarrayReduce()
and structFilter()
to do it using an intermediate struct to count the number of occurrences of each value.. They're still "looping" over the array, but it's not a cfloop proper that you're typing.Bryan Anderson
02/02/2022, 8:36 PMMyka Forrest
02/02/2022, 8:36 PMbdw429s
02/02/2022, 8:36 PMbdw429s
02/02/2022, 8:37 PMBryan Anderson
02/02/2022, 8:37 PMbdw429s
02/02/2022, 8:37 PMBryan Anderson
02/02/2022, 8:38 PMAdam Cameron
bdw429s
02/02/2022, 8:41 PMbdw429s
02/02/2022, 8:41 PMAdam Cameron
Adam Cameron
.keyArray
call on that (depending on requirements), Brad. But good answer.bdw429s
02/02/2022, 8:43 PMBryan Anderson
02/02/2022, 8:44 PMAdam Cameron
bdw429s
02/02/2022, 8:45 PMstructFilter()
(assuming you're looking at my example) because the output of the arrayReduce()
is a struct whose keys contain each unique value int he array and the values contain the occurrence countBryan Anderson
02/02/2022, 8:46 PMbdw429s
02/02/2022, 8:46 PMBryan Anderson
02/02/2022, 8:46 PMbdw429s
02/02/2022, 8:47 PMBryan Anderson
02/02/2022, 8:48 PMbhartsfield
02/02/2022, 8:52 PMBryan Anderson
02/02/2022, 8:54 PMBryan Anderson
02/02/2022, 8:54 PMbhartsfield
02/02/2022, 8:56 PMbhartsfield
02/02/2022, 8:58 PMbhartsfield
02/02/2022, 9:02 PMbhartsfield
02/02/2022, 9:03 PMBryan Anderson
02/02/2022, 9:03 PMBryan Anderson
02/02/2022, 9:03 PMBryan Anderson
02/02/2022, 9:18 PMbdw429s
02/02/2022, 9:20 PMBryan Anderson
02/02/2022, 9:20 PMbdw429s
02/02/2022, 9:20 PMbdw429s
02/02/2022, 9:21 PMbdw429s
02/02/2022, 9:21 PMAdam Cameron
Adam Cameron
Adam Cameron
Struct.insert
, anyhowbdw429s
02/02/2022, 9:37 PMbdw429s
02/02/2022, 9:38 PMstructInsert()
says it returns a boolean 🤮 but I would the member function "fixed" thatAdam Cameron
bdw429s
02/02/2022, 9:39 PMstr.insert()
doesn't override an existing key 😕Adam Cameron
Adam Cameron
Adam Cameron
insert
that overwrite flagbdw429s
02/02/2022, 9:41 PMAdam Cameron
Adam Cameron
Adam Cameron
structGet
a moment ago.Adam Cameron
Bryan Anderson
02/02/2022, 9:48 PMAdam Cameron
Adam Cameron
Bryan Anderson
02/02/2022, 9:58 PMbhartsfield
02/02/2022, 10:46 PMoffset=0;
a.each( ( v, i, a ) => {
if( v != i + offset ) {
dump( i + offset );
offset++;
}
} );