# JavaScript Chrome console - uncaught referenceerror

**URL:** <https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352>\
**Category:** JavaScript\
**Created:** [October 29, 2020, 1:32pm UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352 "2020-10-29T13:32:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![drew.star](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@drew.star](https://forum.codewithmosh.com/u/drew.star)\
**Post date:** [October 29, 2020, 1:32pm UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/1 "2020-10-29T13:32:20Z")

</div>

I must have missed a course (or am yet to get to it) but I am stuck trying to follow the data structures course with inspecting objects printed in the console, as well as use the console to define new objects like a ‘stack’

The console doesn’t display the solid ‘\>’ dropdown mark meaning inspection isn’t possible for me, and I get an error (mentioned in title) when trying to create a ‘stack’

I’m doing something wrong but after hours of creative searching I cannot find any resource to help me on my way here… any help would be much appreciated

TIA

---

<div class="post-metadata">

**Author:** ![hakuhal](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@hakuhal](https://forum.codewithmosh.com/u/hakuhal)\
**Post date:** [October 29, 2020, 5:05pm UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/2 "2020-10-29T17:05:19Z")

</div>

Could you upload your code and error captures?

---

<div class="post-metadata">

**Author:** ![drew.star](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@drew.star](https://forum.codewithmosh.com/u/drew.star)\
**Post date:** [November 2, 2020, 10:49am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/3 "2020-11-02T10:49:38Z")

</div>

Sure, no problem!

 ![Chrome console error](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/2c3c017f4cffc03e219cb311f7692dccb7ad4222.png)

---

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 3, 2020, 8:28am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/4 "2020-11-03T08:28:26Z")

</div>

can you upload your code ?

---

<div class="post-metadata">

**Author:** ![drew.star](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@drew.star](https://forum.codewithmosh.com/u/drew.star)\
**Post date:** [November 3, 2020, 9:16am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/5 "2020-11-03T09:16:10Z")

</div>

This is where I feel I have missed a step/tutorial…

I’m following along with Mosh using VSCode, IntelliJ, et al. and the built-in terminals/consoles, suddenly he switches to executing in a browser console and I cannot continue without returning the error in the image

Normally Mosh would run through basic tools in a course but this seems to have gotten past me somehow

---

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 3, 2020, 9:28am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/6 "2020-11-03T09:28:56Z")

</div>

Do you have problem using live server in VsCode? because when i saw this post and went to check my code the server just runs and i should go to browser by myself and give it the address, before that it would just run the browser by itself and i did try everything from last night and today but nothing worked 😞

---

<div class="post-metadata">

**Author:** ![drew.star](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@drew.star](https://forum.codewithmosh.com/u/drew.star)\
**Post date:** [November 3, 2020, 9:51am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/7 "2020-11-03T09:51:29Z")

</div>

I haven’t any problems displaying code using Live Server, but the problem persists in console regardless… I’ve tried using different browsers on both Windows and Macs, even using Node app and the same error is returned, hence the thinking I’ve skipped steps

I suppose it’s ok and I can assume what Mosh is teaching (properties, inheritance, prototypes, etc.) is happening in the background, but I really would like to have created my own examples as this is all still relatively new to me

---

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 3, 2020, 10:04am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/8 "2020-11-03T10:04:22Z")

</div>

Try this code, see what happens

```auto

 class Stack {

   constructor() {

     _items.set(this, []);

   }

   push(obj) {

     _items.get(this).push(obj);

   }

   pop() {

     const items = _items.get(this);

     if (items.length === 0) {

       throw new Error("Stack Is Empty!");

     }

     return items.pop();

   }

   peek() {

     const items = _items.get(this);

     if (items.length === 0) {

       throw new Error("Stack Is Empty!");

     }

     return items[items.length - 1];

   }

   get count() {

     return _items.get(this).length;

   }

 }
```

---

<div class="post-metadata">

**Author:** ![drew.star](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@drew.star](https://forum.codewithmosh.com/u/drew.star)\
**Post date:** [November 3, 2020, 11:05am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/9 "2020-11-03T11:05:19Z")

</div>

Thanks buddy you’ve helped me solve this and bridge a few ‘knowledge gaps’ as well, was able to execute the declarations live in the console window

I know this is/was entry-level stuff you’ve helped me with, and I am grateful for the assistance

---

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [November 3, 2020, 11:19am UTC](https://forum.codewithmosh.com/t/javascript-chrome-console-uncaught-referenceerror/352/10 "2020-11-03T11:19:37Z")

</div>

No problem, glad to help you 🙂 ❤
