Skip to content

Commit 9e7338b

Browse files
authored
Q19 solution fix
1 parent b86ec27 commit 9e7338b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

challenges/objects.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ const obj = {
534534
}
535535
},
536536

537-
key: "value"
537+
key1: "value1",
538+
key2: "value2",
539+
key3: "value3"
538540
}
539541
```
540542

@@ -546,7 +548,9 @@ const obj = {
546548
}
547549
},
548550

549-
key: "value"
551+
key1: "value1",
552+
key2: "value2",
553+
key3: "value3"
550554
}
551555
```
552556

@@ -559,10 +563,10 @@ const obj = {
559563
### Stringify an object by excluding the 'password' property
560564
```js
561565
// Example
562-
var obj = {
566+
const obj = {
563567
id: 1,
564568
username: 'John',
565-
passowrd: 'secret',
569+
password: 'secret',
566570
email: 'john@email.com',
567571
};
568572
```
@@ -571,11 +575,11 @@ var obj = {
571575
- It accepts 2nd argument which can be a function or array
572576

573577
```js
574-
JSON.stringify(obj, (key, value) => key === 'password' ? undefined : value));
578+
JSON.stringify(obj, (key, value) => key === 'password' ? undefined : value); // {"id":1,"username":"John","email":"john@email.com"}
575579
```
576580

577581
```js
578-
JSON.stringify(obj, ['id', 'username', 'email']);
582+
JSON.stringify(obj, ['id', 'username', 'email']); // {"id":1,"username":"John","email":"john@email.com"}
579583
```
580584

581585
###### References
@@ -598,10 +602,12 @@ var obj = {
598602
console.log("Id: " + this.id);
599603
return this;
600604
},
605+
601606
displayName(){
602607
console.log("Name: " + this.username);
603608
return this;
604609
},
610+
605611
displayDept(dept){
606612
if(typeof dept !== "undefined"){
607613
this.dept = dept;

0 commit comments

Comments
 (0)