Skip to content

Commit e358ec5

Browse files
committed
Fixed results for Getter and setter functions.
'emp.name' is returning the name in upper case. Fixed it.
1 parent a0bfd06 commit e358ec5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,14 +1163,15 @@ var emp = new Employee("James Bond");
11631163

11641164
// uses the get method in the background
11651165
if (emp.name) {
1166-
console.log(emp.name); // Mr. James Bond
1166+
console.log(emp.name); // Mr. JAMES BOND
11671167
}
11681168

11691169
// uses the setter in the background
11701170
emp.name = "Bond 007";
1171-
console.log(emp.name); // Mr. Bond 007
1171+
console.log(emp.name); // Mr. BOND 007
11721172
```
11731173

1174+
11741175
Latest browsers are also supporting getter/setter functions in Objects and we can use them for computed properties, adding listeners and preprocessing before setting/getting:
11751176

11761177
```javascript

0 commit comments

Comments
 (0)