# Question about arguments for a function

**URL:** <https://forum.kirupa.com/t/question-about-arguments-for-a-function/160301>\
**Category:** Uncategorized\
**Created:** [August 24, 2005, 11:01pm UTC](https://forum.kirupa.com/t/question-about-arguments-for-a-function/160301 "2005-08-24T23:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lava](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@lava](https://forum.kirupa.com/u/lava)\
**Post date:** [August 24, 2005, 11:01pm UTC](https://forum.kirupa.com/t/question-about-arguments-for-a-function/160301/1 "2005-08-24T23:01:58Z")

</div>

I have a question, is there a way to pass the arguments of a function as an array? To be more specific, let’s say I have a function

```auto
foo = function(arg1, arg2, arg3){
	// something
}

```

of course, that’s called like this:

```auto
foo(1, 2, x);

```

but can I somehow pass the arguments as an array? like this:

```auto
bar = [1, 2, x]
foo(bar);

```

I know that particular code doesn’t work, but I’m wondering if there’s some syntactic sugar that will let me do this. I’m doing some work with the drawing API and I don’t feel like passing 17 separate variables to a function.

Thanks
