Skip to content

Commit 84f1257

Browse files
homework_3 fixed
1 parent 2e5c405 commit 84f1257

File tree

1 file changed

+7
-4
lines changed
  • js-core/homeworks/homework-3/src

1 file changed

+7
-4
lines changed

js-core/homeworks/homework-3/src/main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
function returnObject(value) {
77
let obj = {
8-
name: 'someName'
8+
name: value
99
}
10-
obj.name = value
1110

1211
return obj
1312
}
@@ -23,8 +22,12 @@ console.log(someObject);
2322
*/
2423

2524
function toUpperCase(obj) {
26-
obj.name = obj.name.toUpperCase()
27-
return obj
25+
let newObj = {
26+
name: obj.name.toUpperCase()
27+
}
28+
29+
30+
return newObj
2831
}
2932
const objectWithName = { name: 'privet kak dela' };
3033
console.log(toUpperCase(objectWithName));

0 commit comments

Comments
 (0)