Thanks guys, I decided to do it the following way:
var Circle = function( radius )
{
var _radius = radius;
this.radius = function()
{
return _radius;
};
this.area = function()
{
return Math.PI * _radius * _radius;
}
this.perimeter = function()
{
return 2 * Math.PI * _radius;
}
this.setRadius = function( radius ) {
_radius = radius;
};
};
It works now. Thanks for the tips!