# Error: shape(color) , Super Contructor

**URL:** <https://forum.codewithmosh.com/t/error-shape-color-super-contructor/11431>\
**Category:** JavaScript\
**Created:** [March 23, 2022, 4:58am UTC](https://forum.codewithmosh.com/t/error-shape-color-super-contructor/11431 "2022-03-23T04:58:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![isourire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/isourire/32/3509_2.png) [@isourire](https://forum.codewithmosh.com/u/isourire)\
**Post date:** [March 23, 2022, 4:58am UTC](https://forum.codewithmosh.com/t/error-shape-color-super-contructor/11431/1 "2022-03-23T04:58:21Z")

</div>

Prototypical Inheritance (50m) ==\>\> 3- Calling the Super Constructor (3:48)  
]([https://codewithmosh.com/courses/310571/lectures/4881274](https://codewithmosh.com/courses/310571/lectures/4881274))

## Mosh’s code will report error in chrome console, “Uncaught ReferenceError:color is not defined” !!!

function Shape(color) {

this.color = color;

}

Shape.prototype.duplicate = function() {

console.log(‘duplicate’);

}

function Circle(radius) {

Shape.call(this, color);

this.radius = radius;

}

Circle.prototype = Object.create(Shape.prototype);

Circle.prototype.constructor = Circle;

Circle.prototype.draw = function() {

console.log(‘draw’);

}

const s = new Shape();

const c = new Circle(1, ‘red’);

* * *

Any other information I can provide, what I can do?

---

<div class="post-metadata">

**Author:** ![isourire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/isourire/32/3509_2.png) [@isourire](https://forum.codewithmosh.com/u/isourire)\
**Post date:** [March 23, 2022, 8:01am UTC](https://forum.codewithmosh.com/t/error-shape-color-super-contructor/11431/2 "2022-03-23T08:01:43Z")

</div>

remove below line, it will be goooood:  
Shape.call(this, color);

---

<div class="post-metadata">

**Author:** ![larryhems](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@larryhems](https://forum.codewithmosh.com/u/larryhems)\
**Post date:** [June 23, 2022, 4:39pm UTC](https://forum.codewithmosh.com/t/error-shape-color-super-contructor/11431/3 "2022-06-23T16:39:49Z")

</div>

> [@isourire](#):
>
> “Uncaught ReferenceError:color is not defined” !!!

If you are using any script file and getting "Uncaught ReferenceError: ‘color’ is not defined " which means ‘color’ is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this ‘color’ is [not defined](http://net-informations.com/jq/iq/defined.htm) error . This usually indicates that your library is not loaded and JavaScript does not recognize the ‘color’.

To solve this error: Load the jQuery CDN library at the beginning of all your javascript files/scripts which uses $/ jQuery, so that $/jQuery can be identified in scripts .

There can be multiple other reasons for this issue:

- Conflict with Other Libraries
- Path to your library included is not correct
- Llibrary file is corrupted
- Working offline (when you use CDN)
