# Prototype: call method from another method

**URL:** <https://forum.kirupa.com/t/prototype-call-method-from-another-method/294499>\
**Category:** web dev\
**Created:** [August 15, 2009, 1:30am UTC](https://forum.kirupa.com/t/prototype-call-method-from-another-method/294499 "2009-08-15T01:30:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [August 15, 2009, 1:30am UTC](https://forum.kirupa.com/t/prototype-call-method-from-another-method/294499/1 "2009-08-15T01:30:15Z")

</div>

I’m using the [Prototype JS library](http://www.prototypejs.org/learn/class-inheritance) to make classes.

```php

var myClass = Class.create({
   initialize: function() {
      this.myValue = 5;
   },
   returnHello: function() {
      return 'hello';
   },
   explainYourself: function() {
      return this.returnHello() + ", my value is: " + this.myValue;
   }
}); 

```

In explainYourself(), I tried to call returnHello() and I got an error saying this.returnHello() is not a function. What is the correct syntax?

And how do you make field and methods private/public/protected in Prototype?
