File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ const profile = {
43
43
44
44
// d) Explain why the current return value is different from the target output
45
45
// The current return value is different from the target output because the function
46
- // is working improperly. First of all, the key should be taken on brackets to make possible
47
- // to read every key name-value and value in every pair in subarray.
46
+ // is working improperly. First of all, the key should be taken in brackets to make it possible
47
+ // to read every key name-value and value in every pair in the subarray.
48
48
// invertedObj.key = value: This is a direct assignment. It treats "key" as a literal string
49
49
// and creates or updates a property named "key" on the invertedObj object, setting its value
50
- // to the value of the value variable.
50
+ // to the value of the variable.
51
51
// invertedObj[key] = value: This uses bracket notation. It evaluates the key variable and uses
52
52
// its value (which is a string) as the property name on invertedObj.
53
- // Secondly, change the key and value places for new object creation statement
54
- // 'invertedObj[value] = key;' to get swapping the keys and values in the new object.
53
+ // Secondly, change the key and value places for the new object creation statement
54
+ // 'invertedObj[value] = key;' to swap the keys and values in the new object.
55
55
56
56
// e) Fix the implementation of invert (and write tests to prove it's fixed!)
57
57
You can’t perform that action at this time.
0 commit comments