SHARE
TWEET

Untitled

a guest Jun 24th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function EmployeeDetails() {
  2.   var name: "Mayank";
  3.   var age = 30;
  4.   var designation = "Developer",
  5.   var salary = 10000;
  6.  
  7.   var calculateBonus = function(amount) {
  8.     salary = salary + amount;
  9.   }
  10.  
  11.   return {
  12.     name: name,
  13.     age: age,
  14.     designation: designation,
  15.     calculateBonus: calculateBonus
  16.   }
  17. }
  18.  
  19. var newEmployee = EmployeeDetails()
  20.  
  21. var userName = newEmployee.calculateBonus(1000);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top