eval.in

Paste #199

JavaScript — Node 0.8.8, pasted 5 years ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function Greeter(name) {
  this.name = name;
}

Greeter.prototype.greet = function() {
  console.log("Hello %s!", this.name);
};

var greeter = new Greeter("Charlie");
greeter.greet();

Program Output

Hello Charlie!

OK (0.040 sec real, 0.040 sec wall, 42 MB, 27 syscalls)

Fork