function Shape() {
this.name = "Generic";
this.draw = function() {
return "Drawing " + this.name + " Shape";
};
}
function welcomeMessage()
{
var shape1 = new Shape();
//alert(shape1.draw());
alert(shape1.hasOwnProperty(name)); //this is returning false
}
Run Code Online (Sandbox Code Playgroud)
.welcomeMessage呼吁这个body.onload事件.
我期望shape1.hasOwnProperty(name)返回true,但它返回false.
什么是正确的行为?
目前我需要构建和更新大型xml文件.那么创建或更新xml文件的最佳C#xml解析器是什么?我在c#中听说过LINQ,可以用吗?