# Question about the "arguments" object

**URL:** <https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922>\
**Category:** General\
**Created:** [August 10, 2017, 2:11am UTC](https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922 "2017-08-10T02:11:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cecxc](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cecxc](https://forum.freecodecamp.org/u/cecxc)\
**Post date:** [August 10, 2017, 2:11am UTC](https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922/1 "2017-08-10T02:11:05Z")

</div>

Hi all!

I just finished the Symmetric Difference challenge but came across something involving the “arguments” object while working it that I don’t understand.

I’ve outlined the core of the problem below in case anyone that hasn’t done the challenge knows the answer to this question.

When I execute the following function,

```auto
function test () {
  var ans = 1;
  if (arguments[1] == arguments[0]) {
    ans = 2;
  }
  return ans;
}
test(1, 1);

```

the function returns 2. However, if I execute the exact same function but change the arguments as follows,

```auto
function test () {
  var ans = 1;
  if (arguments[1] == arguments[0]) {
    ans = 2;
  }
  return ans;
}
test([1, 2], [1, 2]);

```

the function returns 1.

Why exactly does this happen?

---

<div class="post-metadata">

**Author:** ![Matthew-Keating](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Matthew-Keating](https://forum.freecodecamp.org/u/Matthew-Keating)\
**Post date:** [August 10, 2017, 2:22am UTC](https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922/2 "2017-08-10T02:22:54Z")

</div>

When comparing arrays in javscript it checks if they are the same instance.

```auto
let x = [1,1];
let y = [1,1];
let z = x;

console.log(x == y); // false
console.log(x == x); // true
console.log(x == z); // true

```

---

<div class="post-metadata">

**Author:** ![cecxc](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cecxc](https://forum.freecodecamp.org/u/cecxc)\
**Post date:** [August 10, 2017, 2:28am UTC](https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922/3 "2017-08-10T02:28:22Z")

</div>

Ok, so it doesn’t necessarily apply only to arrays passed through with the arguments object, but to all arrays in general. Thanks!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:43pm UTC](https://forum.freecodecamp.org/t/question-about-the-arguments-object/140922/4 "2021-01-17T20:43:10Z")

</div>


