I read and understand a lot of russian but I'd rather not try to write it.
Hope answer in english will be of any help to you.
To have private functions and properties you need to use clousure like this:
var AClass = Class.create((function()
{
var _stat = 'I am static private';
function
Sorry, one not so small mistake: should be
function initialize()
{
this.test = 'I am public';
}
this is public of course
I read and understand a lot of russian but I'd rather not try to write
it.
Hope answer in english will be of any help to you.
To have private functions
а вот так
var myClass= Class.create(
{ initialize:function(str)
{ this.str=str ;
this.msg=function()
{alert (privat+this.str);}
} ,
public:function()
{alert (public+this.str)}
}
)
метод msg приватный или нет
--
You
No, this method `msg` is public.
But if you create
var myClass= Class.create(
{ initialize:function(str)
{ this.str=str ;
msg=function()
{alert (privat+this.str);}
} ,
public:function()
{alert (public+this.str)}
}
)
понедельник, 7 января 2013 г., 20:59:28 UTC+2 пользователь mikhail написал:
No, this method `msg` is public.
But if you create
var myClass= Class.create(
{ initialize:function(str)
{ this.str=str ;
msg=function()
{alert