but then it works with numbers only and the function is not so generic anymore ?

What disturbs you with `undefined` or `arguments` ?