//
function Word(words){
this.words = words;
}
Word.prototype = {
alert(){
alert(this.words);
}
}
//
var w = new Word("hello world");
w.print = function(){
console.log(this.words);
console.log(this); //Person
}
w.print(); //hello world
w.alert(); //hello world
{
alert(){
alert(this.words);
}
}