let obj_kaushal = {
firstname:'kaushal',
lastname:'shukla',
fullname:function(){
return this.firstname+' '+this.lastname;
}
}
function say_hello(t,a) {
console.log('hello '+this.fullname(),t,a)
//return 'hello '+this.firstname;
}
//say_hello.call(obj_kaushal,'hi','how are you');
//say_hello.apply(obj_kaushal,['hi','how are you']);
// let x = say_hello.bind(obj_kaushal,'hi','how are you');
// x();
class User {
constructor(){
this.firstname = 'kaushal';
this.lastname = 'shukla';
}
fullname(){
return this.firstname+' '+this.lastname;
}
say_hello2(t,a){
console.log(this.firstname,this.lastname,this.fullname(),t,a)
//return 'hello '+this.firstname;
}
}
let kaushal = new User();
kaushal.say_hello2('hi','how are you');