Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function EmployeeDetails() {
- var name: "Mayank";
- var age = 30;
- var designation = "Developer",
- var salary = 10000;
- var calculateBonus = function(amount) {
- salary = salary + amount;
- }
- return {
- name: name,
- age: age,
- designation: designation,
- calculateBonus: calculateBonus
- }
- }
- var newEmployee = EmployeeDetails()
- var userName = newEmployee.calculateBonus(1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement