arguments
オブジェクトのサブセットを取得する方法はありますか? たとえば、最初の引数 (「末尾」) の後の引数のみを選択しますか?
Python では、次のように実行できます。
def tail(*xs): # * means a tuple of parameters of variable size
return xs[1:] # return from index 1, to the end of the list
tail(1, 2, 3, 4) # returns (2, 3, 4)
JavaScript で同様のことを行う方法はありますか?