Tim
01/10/2024, 9:46 PMAdam Cameron
So I would need arrayFind and array[i].And? Looks like you might be trying to find a solution to a problem you might... not have..?
Adam Cameron
Adam Cameron
Array.some I guess.Tim
01/10/2024, 10:40 PMpublic Thing function getThing(required string key) {
var foundIndex = getThings().find(thing => thing.getKey() == key);
if( foundIndex > 0 ) {
return getThings()[foundIndex];
}
return new Thing();
}
public Thing function getThing(required string key) {
for( var thing in getThings() ) {
if( thing.getKey() == key ) {
return thing;
}
}
return new Thing();
}Adam Cameron
Adam Cameron
nullValue instead of that inline hand-cranked version, which works on both)Tim
01/10/2024, 10:58 PM?: That would shorten it up.Adam Cameron
Tim
01/10/2024, 11:02 PMAdam Cameron
Dave Merrill
01/11/2024, 4:03 PMTim
01/11/2024, 4:04 PMDave Merrill
01/11/2024, 4:07 PM