You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Find an element// -- throws an exception unless results.length !== 1find('string')// Find any/all elements// -- finds any number of elements (including 0)// -- could be used by the find functionfindAll('string')// Find a specific number of elements// -- throws an exception unless results.length == numberfind(3,'string')// alternativelyfind('string',{length: 3})
I believe this would remove the necessity for tryfind, as you could just do a findAll. This loosely borrows it's behavior/syntax from ActiveRecord, where find() will throw an exception or return 1 element and find_all just returns any number of elements and doesn't throw an exception in any case.
The text was updated successfully, but these errors were encountered:
Proposed functionality for find/findAll:
I believe this would remove the necessity for tryfind, as you could just do a findAll. This loosely borrows it's behavior/syntax from ActiveRecord, where find() will throw an exception or return 1 element and find_all just returns any number of elements and doesn't throw an exception in any case.
The text was updated successfully, but these errors were encountered: