Is there a method to pass an array's elements as arguments to a function?
For instance, in Python I can accomplish this using:
user = ["John", "Doe"]
def full_name(first_name, last_name):
return first_name + last_name
Therefore, full_name(*user)
unpacks the user
array and uses each item as an argument for the full_name
function.
Can a similar functionality be achieved in JavaScript/TypeScript?