# \[Record Collection\]Why when i try to console.log() the value of a property it logs the whole object

**URL:** <https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069>\
**Category:** General\
**Created:** [June 27, 2016, 10:44pm UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069 "2016-06-27T22:44:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastianhew](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sebastianhew/32/163430_2.png) [@sebastianhew](https://forum.freecodecamp.org/u/sebastianhew)\
**Post date:** [June 27, 2016, 10:44pm UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/1 "2016-06-27T22:44:42Z")

</div>

Hey guys,

I modified the code in the Record Collection exercise to check something in the console:

```
// Setup
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": []
    },
    "5439": {
      "album": "ABBA Gold"
    }
};

var test = collection[2548].artist;
  console.log(test);

```

It’s weird to me, but it logs the whole collection object. How and why?

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [June 28, 2016, 3:12am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/2 "2016-06-28T03:12:51Z")

</div>

Works for me - I get `Bon Jovi` in console.

---

<div class="post-metadata">

**Author:** ![ChadKreutzer](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/chadkreutzer/32/159254_2.png) [@ChadKreutzer](https://forum.freecodecamp.org/u/ChadKreutzer)\
**Post date:** [June 28, 2016, 6:01am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/3 "2016-06-28T06:01:46Z")

</div>

Worked just fine for me too. Are you using an odd browser? Sometimes Firefox and Safari act differently than M$ and Chrome.

---

<div class="post-metadata">

**Author:** ![sebastianhew](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sebastianhew/32/163430_2.png) [@sebastianhew](https://forum.freecodecamp.org/u/sebastianhew)\
**Post date:** [June 28, 2016, 10:39am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/4 "2016-06-28T10:39:35Z")

</div>

Ok, so it’s the browser’s fault. For a moment i was like "Whaaaaaaaaa…t : O "

I use chrome, don’t know why it occurs

---

<div class="post-metadata">

**Author:** ![ChadKreutzer](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/chadkreutzer/32/159254_2.png) [@ChadKreutzer](https://forum.freecodecamp.org/u/ChadKreutzer)\
**Post date:** [June 28, 2016, 11:14am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/5 "2016-06-28T11:14:15Z")

</div>

Not necessarily. I’m using Chrome too. And it was just fine for me. Is it still doing it? You wanna paste the whole code (even the boiler plate)? Maybe you inadvertently changed something.

---

<div class="post-metadata">

**Author:** ![sebastianhew](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sebastianhew/32/163430_2.png) [@sebastianhew](https://forum.freecodecamp.org/u/sebastianhew)\
**Post date:** [June 28, 2016, 9:27pm UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/6 "2016-06-28T21:27:01Z")

</div>

I gave up trying to figure it out. But then later, I have this in another challenge:

[https://www.freecodecamp.com/challenges/profile-lookup#](https://www.freecodecamp.com/challenges/profile-lookup#)

 ![](https://global.discourse-cdn.com/freecodecamp/original/2X/3/329a25c02b1ba0a3e0636305b7b0015853004f82.png)

I click “Run tests” and nothing appears. Is it my fault here? Or another weird thing with chrome?

```
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];

var test = contacts[0].likes;
console.log(test);
```

---

<div class="post-metadata">

**Author:** ![bnoden](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bnoden/32/4753_2.png) [@bnoden](https://forum.freecodecamp.org/u/bnoden)\
**Post date:** [June 29, 2016, 12:16am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/7 "2016-06-29T00:16:10Z")

</div>

Okay so the problem seems to be that you are mistaking CodeMirror for the console. CodeMirror returns the results of the exercise’s function, in this case `lookUpProfile()`. If you haven’t defined the function, it returns nothing. To see your console.log, press F12 and make sure the Console is open.

---

<div class="post-metadata">

**Author:** ![sebastianhew](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sebastianhew/32/163430_2.png) [@sebastianhew](https://forum.freecodecamp.org/u/sebastianhew)\
**Post date:** [June 29, 2016, 12:22am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/8 "2016-06-29T00:22:22Z")

</div>

> [@bnoden](#):
>
> function,

Thanks, it’s not clear to me how to use console.log on FCC. I don’t have problems using it on codepen, but here nothing works in the console, when i try to log something from the website . For example console.log(contacts); does not work .

---

<div class="post-metadata">

**Author:** ![bnoden](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bnoden/32/4753_2.png) [@bnoden](https://forum.freecodecamp.org/u/bnoden)\
**Post date:** [June 29, 2016, 12:58am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/9 "2016-06-29T00:58:00Z")

</div>

![](https://global.discourse-cdn.com/freecodecamp/original/2X/5/528366a7d2ef8037eeb11ed05483bc1868f69c0f.png)

---

<div class="post-metadata">

**Author:** ![ChadKreutzer](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/chadkreutzer/32/159254_2.png) [@ChadKreutzer](https://forum.freecodecamp.org/u/ChadKreutzer)\
**Post date:** [June 29, 2016, 5:33am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/10 "2016-06-29T05:33:05Z")

</div>

You are on Chrome, right? press `ctrl-shift-I` to open the console (the panel to the right on @bnoden 's screen pic). Sometime the Elements tab will be active, then just click the Console tab and you will be in business.

---

<div class="post-metadata">

**Author:** ![Kathuter](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kathuter/32/38778_2.png) [@Kathuter](https://forum.freecodecamp.org/u/Kathuter)\
**Post date:** [February 9, 2017, 8:06am UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/11 "2017-02-09T08:06:24Z")

</div>

Awesome, #ChadKreutzer. Thank you, this solved my issues. Ghostery, dear Ghostery caused me plenty of problems! Only now did I understand why I get all the ‘security’ issues.

---

<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, 1:10pm UTC](https://forum.freecodecamp.org/t/record-collection-why-when-i-try-to-console-log-the-value-of-a-property-it-logs-the-whole-object/15069/12 "2021-01-16T13:10:08Z")

</div>


