# Lesson Not Intuitive

**URL:** <https://forum.freecodecamp.org/t/lesson-not-intuitive/269286>\
**Category:** freeCodeCamp Contributors\
**Tags:** contributing\
**Created:** [April 4, 2019, 7:02pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286 "2019-04-04T19:02:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dylanhamada](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dylanhamada/32/298773_2.png) [@dylanhamada](https://forum.freecodecamp.org/u/dylanhamada)\
**Post date:** [April 4, 2019, 7:02pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286/1 "2019-04-04T19:02:27Z")

</div>

In the lesson **[Basic Data Structures: Iterate Through the Keys of an Object with a for…in Statement](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/-iterate-through-the-keys-of-an-object-with-a-for---in-statement/)**, I have a suggestion to make a portion of it more intuitive. I got confused upon the first reading and attempting of the challenge.

The issue concerns this snippet of code in particular:

```auto
for (let user in users) {
  console.log(user);
};

```

It’s not intuitive that _user_ is referring to a string, and not to another object. It’s not explained very well in the lesson text.

I think that if it were made explicit that _user_ was referring to a string, it would lead to less confusion. Students would recognize that they couldn’t just access something like _user.someProperty_, and would have to access the parent object like _parentObject.user.someProperty_.

---

<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:** [April 4, 2019, 7:19pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286/2 "2019-04-04T19:19:06Z")

</div>

“Sometimes you may need to iterate through all the keys within an object.”

An object key is always a string.

---

<div class="post-metadata">

**Author:** ![dylanhamada](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dylanhamada/32/298773_2.png) [@dylanhamada](https://forum.freecodecamp.org/u/dylanhamada)\
**Post date:** [April 4, 2019, 8:59pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286/3 "2019-04-04T20:59:30Z")

</div>

Ok thanks for the clarification. I don’t remember if this was made explicit in the earlier sections on Objects.

---

<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:** [April 4, 2019, 9:03pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286/4 "2019-04-04T21:03:22Z")

</div>

It was in the [first lesson on objects](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/build-javascript-objects), which I know several challenges ago and I’m sure that your brain is crammed full of new material.

> In this example, all the properties are stored as strings, such as - `"name"` , `"legs"` , and `"tails"` . However, you can also use numbers as properties. You can even omit the quotes for single-word string properties…
> 
> However, if your object has any non-string properties, JavaScript will automatically typecast them as strings.

---

<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, 7:59pm UTC](https://forum.freecodecamp.org/t/lesson-not-intuitive/269286/5 "2021-01-17T19:59:13Z")

</div>


