- Arrow function -
@iam_keen
I'm Your Father
No~~~~~~~~
var DarthVaderSays = function(){
this.name = "Darth Vader";
this.start = function(){
console.log(this.name + " says: ----------I'm Your father!----------" );
}
}
var Action = function(){
this.name = "Luke Skywalker";
this.start = function(){
setTimeout( vader.start, 1000 );
setTimeout( function(){
console.log( this.name+" says: ----------No~~~~~~~~~~~~~--");
console.log( "Starwars Ends----------]");
}, 1200 );
}
}
var DarthVaderSays = function(){
this.name = "Darth Vader";
self = this;
this.start = function(){
console.log(self.name + " says: ----------I'm Your father!----------" );
}
}
var action = function(){
this.name = "Luke Skywalker";
self = this;
setTimeout( vader.start, 1000 );
setTimeout( function(){
console.log( self.name+" says: ----------No~~~~~~~~~~~~~--");
console.log( "Starwars Ends----------]");
}, 1200 );
}
var DarthVaderSays = function(){
this.name = "Darth Vader";
this.start = function(){
console.log(this.name + " says: ----------I'm Your father!----------" );
}
}
var action = function(){
this.name = "Luke Skywalker";
setTimeout( vader.start.call(vader), 1000 );
setTimeout( function(){
console.log( this.name+" says: ----------No~~~~~~~~~~~~~--");
console.log( "Starwars Ends----------]");
}, 1200 );
}
var DarthVaderSays = function(){
this.name = "Darth Vader";
this.start = ()=>{
console.log(this.name + " says: ----------I'm Your father!----------" );
}
}
var action = {
name : "Luke Skywalker",
start : function(){
setTimeout( vader.start, 1000 );
setTimeout(()=>{
console.log( this.name+" says: ----------No~~~~~~~~~~~~~--");
console.log( "Starwars Ends----------]");
}, 1200 );
}
}
node --harmony somefile.js
babel-node arrow.js
Classes
https://github.com/ehrudxo/es6_study