小编Thi*_*n S的帖子

在javascript中的hasOwnProperty

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.

什么是正确的行为?

javascript

73
推荐指数
2
解决办法
13万
查看次数

C#中的XML构造

目前我需要构建和更新大型xml文件.那么创建或更新xml文件的最佳C#xml解析器是什么?我在c#中听说过LINQ,可以用吗?

c# xml linq

4
推荐指数
1
解决办法
191
查看次数

标签 统计

c# ×1

javascript ×1

linq ×1

xml ×1