Create a function that takes a list of functions and sorts them in ascending order based on how many calls are needed for them to return a non-function.
f1 = _ => "hello"
// f1() ➞ "hello"
f2 = _ => _ => "innokodakademija"
// f2()() ➞ "innokodakademija"
f3 = _ => _ => _ => "user"
// f3()()() ➞ "user"
funcSort([f2, f3, f1]) ➞ [f1, f2, f3]
// [f2, f3, f1] ➞ [2, 3, 1] ➞ [1, 2, 3] ➞ [f1, f2, f3]
funcSort([f1, f2, f3]) ➞ [f1, f2, f3]
// [f1, f2, f3] ➞ [1, 2, 3] ➞ [1, 2, 3] ➞ [f1, f2, f3]
funcSort([f2, "func"]) ➞ ["func", f2]
// [f2, "func"] ➞ [2, 0] ➞ [0, 2] ➞ ["func", f2]
Numbers, Booleans, and Strings, among others.