Looking for suggestions on implementing a function that takes an array A containing n elements and a number k as input. The function should return an array consisting of all subsets of size k from A, with each subset represented as an array.
Please define the type of the function and provide a minimum of 3 tests using assert to ensure functionality. The function should be written in a functional programming style using Javascript/Typescript.
For example: FunSubsets ([1,2,3],2) => [[1,2],[1,3],[2,3]]
Open to any ideas!