//Create function to different behaviour, same parameter call.constqaSalary=(base)=>base+9000*0.10;constdevSalary=(base)=>base+1000*0.60;//Add function to the object.constbob={name:'Bob',salary:1000,job_type:'DEVELOPER',calc:devSalary};constmary={name:'Mary',salary:1000,job_type:'QA',calc:qaSalary};//Same call.console.log('Salary',bob.calc());console.log('Salary',mary.calc());
Hey Damian the last example is not working.
the output is:
:o :O yes that true, I will fix it. thanks for tell me.