js函数问题
<script>
window.Type=Function;
if(!window)this.window=this;
window.__rootNamespaces=[]; Type.registerNamespace=function(f)
{
window.__rootNamespaces[window.__rootNamespaces.length]=window[f]={};
};
Type.registerNamespace("MyNamespace");
MyNamespace.Employee= function(name)
{
this._Name = name ? name : "zz";
this._Year = 0;
}
MyNamespace.Employee.prototype=
{
get_Name : function()
{
return this._Name;
},
set_Year : function(value)
{
this._Year=value;
},
get_Year : function()
{
return this._Year;
},
Salary : function()
{
return this._Year * 1000;
},
GetDescription : function()
{
return "姓名:"+this._Name+"\n工资:"+this.Salary();
}
}
function SetValue()
{
var k=new MyNamespace.Employee();
k.set_Year(1);
alert(k.get_Name());
alert(k.Salary());
}
SetValue();
</script>
这段代码中红的部分是什么意思?
"[]","{}",尤其是这两个还必不可少,具体是做个什么用?
请大家帮忙解决下疑惑.