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
This function will operate based on how equality and comparison is implemented in T or the user can provide their own sort function. As of right now a default comparer is inside of the class, but it will only work for primitives.
Handling equality and comparisons for non-primitive types
Require a way to deal with equality of more complex objects, such as IEquatable of T or IEqualityComparer of T
Ran into some interesting bumps for this one. The getHashCode() function is not implemented yet, but will be in #4. I have implemented IEquatable<T> and IComparable<T>.
* 3 I was not aware that JavaScript has properties now! I just updated all of my methods that were stand ins for properties into read-only properties in most cases. This is excellent news.
* 3 Performing renames on files to make room for new concepts. Checking in the Complex tests broken in preparation to start filling them out.
* 3 Cleaned up the test copy and removed what wasn't needed for testing. Changed all numbers to ComparableObjects.
* 3 Tests are still failing, but progress made on testing if an item T has implemented an equals function or not.
* 3 Moved files according to their would be dot net framework locations because why not at this point. Fixed multiple tests. Fixed a few bugs. Moved on to implementing IComparable of T.
* 3 Implemented IComparable<T> compareTo and updated all tests to handle the folder changes. All List of T tests now pass.
* 3 Implemented the distinct() function and a unit test for it. That wrap this ticket up.
Handling equality and comparisons for
List<T>
List<T>
constructor to give an optional way to provide a IComparer of T or equivalent for the following functions:contains(item: T): boolean
removes(item: T): boolean
contains
sort(comparison?: (left: T, right: T) => number): void
Handling equality and comparisons for non-primitive types
Unanswered questions
List<T>
automatically pick up how to compare complex T from T?The text was updated successfully, but these errors were encountered: