|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
316 bytes
|
| Line | |
|---|
| 1 | function mapValues(object, getNewValue) {
|
|---|
| 2 | const result = {};
|
|---|
| 3 | const keys = Object.keys(object);
|
|---|
| 4 | for (let i = 0; i < keys.length; i++) {
|
|---|
| 5 | const key = keys[i];
|
|---|
| 6 | const value = object[key];
|
|---|
| 7 | result[key] = getNewValue(value, key, object);
|
|---|
| 8 | }
|
|---|
| 9 | return result;
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | export { mapValues };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.