# Is this a bug or am I missing something?

**URL:** <https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087>\
**Category:** General\
**Created:** [February 1, 2018, 4:02am UTC](https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087 "2018-02-01T04:02:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClavisAurea](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/clavisaurea/32/64214_2.png) [@ClavisAurea](https://forum.freecodecamp.org/u/ClavisAurea)\
**Post date:** [February 1, 2018, 4:02am UTC](https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087/1 "2018-02-01T04:02:31Z")

</div>

I’m not sure if this is a bug or FCC does this for a reason. I just completed the “Record Collection” problem in the Advanced Algorithm section for Front End and noticed that my results changed if I gave the object calls a variable name and called them using the variable name (for example: creating a “var item = collection[id][prop]” and then just using “item” for the rest of the code rather than using “collection[id][prop]” every time). I feel like I should be using DRY coding techniques and using “collection[id][prop]” every time rather than a shorter variable name just doesn’t seem very DRY to me. My code works either way in the dev console; just not in FCC’s challenge page console. I’m curious if there’s a reason for this. I’ve posted a before and after for my [solution](https://codepen.io/ClavisAurea/pen/vdOqOE) to give a bit more context if I’m not explaining this well enough. Thanks.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [February 1, 2018, 4:03pm UTC](https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087/2 "2018-02-01T16:03:53Z")

</div>

`var newProp = collection[id][prop];` sets `newProp` to the value contained in `collection[id][prop]`. Trying to delete it just deletes that variable - not the property `collection[id][prop]`, etc.

---

<div class="post-metadata">

**Author:** ![ClavisAurea](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/clavisaurea/32/64214_2.png) [@ClavisAurea](https://forum.freecodecamp.org/u/ClavisAurea)\
**Post date:** [February 2, 2018, 5:18am UTC](https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087/3 "2018-02-02T05:18:38Z")

</div>

Ah, yeah, actually with a bit more playing around, I realized what the problem was. In addition to deleting the variable, I was also reassigning a variable in parts. 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 16, 2021, 6:45pm UTC](https://forum.freecodecamp.org/t/is-this-a-bug-or-am-i-missing-something/172087/4 "2021-01-16T18:45:04Z")

</div>

Closed on January 16, 2021, 6:45pm UTC


