Skip to content
Advertisement

Tag: return-type

Dynamic return type based on input argument type

I’m trying to write a small function that takes two lists and sorts one based on the elements of the other. So something like: would result in a sorted list [E, C, A, D, B]. However, valuesToSort might be a list of something different, like integers, floats or other lists. Ideally, I would want my program to take any list

Advertisement