What does the '2' in changeset/2 mean?

I’m relatively new to Elixir and Phoenix and notice there’s often a number after a function e.g. changeset/2 and pipeline/2. What does the number represent? Is it the number of expected arguments or parameters?

1 Like

Yup! This is also known as the https://en.wikipedia.org/wiki/Arity of the function. Functions with same name but different arity are considered in Elixir to be different functions. Thus changeset/1 and changeset/2 are different functions.

2 Likes

Thanks for confirming. Arity is a completely new word to me!