I have the map posted below in the code section. what i want to achieve is, to sort the map according to the values ascendingly. so that, after sorting it,
i should the map sorted as shown in last section.

please let me know how can i achieve that.

**code**:

```
const obj1 = new Object();
const obj2 = new Object();
const obj3 = new Object();
const obj4 = new Object();

const map2 = {};
map2[obj1] = 10;
map2[obj2] = -20;
map2[obj3] = 0;
map2[obj4] = 40;

```

**after sorting**:

```
map2[obj2] = -20;
map2[obj3] = 0;
map2[obj1] = 10;
map2[obj4] = 40;

```