Monday, June 1, 2009

Object Oriented Javascript, C# Comparison

C# Code:

public class ClassName : BaseClassName
{
public object PropertyName { get; set; }

public BaseClassName(object argumentName)
{
this.PropertyName = argumentName;
}

public void MethodName()
{
}
}

Javascript Code:

function ClassName(argumentName) {
this.PropertyName = argumentName;
}

ClassName.prototype.MethodName = function() {
}

No comments: