Question: I have a 2D array used to store non-repeated values and some entries are randomly picked and push\_back-ed into a vector as favorite list.

```
int num[10][10];
vector<int> fav_list;
int retrieved_i, retrieved_j, retrieve_vector_position;

for(i=0;i<10;i++) for(j=0;j<10;j++)
// ...assign numbers to num...

fav_list.push_back(num[2][3]);
fav_list.push_back(num[4][7]);
fav_list.push_back(num[6][2]);
//...push_back more random selected num[...][...] into fav_list...

```

The problem is, how can I retrieve the `i, j` index of particular `fav_list[...]`?

I've tried to make struct `struct Num{int value, index_i, index_j;}num[10][10];` so that I can do in this way

```
retrieved_i = fav_list[retrieve_vector_position].index_i;
retrieved_j = fav_list[retrieve_vector_position].index_j;

```

but I wish to know is there any other better/ efficient ways?

Answer: 
notification.js

```
function notification(message, level = 'success') {
    Lobibox.notify(level, {
        delayIndicator: false,
        msg: message

    });
}

window.notification = notification;

```

Solve it. I need to add `window.notification = notification` so I can call it everywhere.
it's better to avoid putting things in window.

It looks like you're using the Vue with webpack. If you're not, then this won't work. If you are, you're better off using ES6 modules to make sure you have access to things where you need them.

Within your notification.js file:

```
export default user

```

Which you can then call on

```
import notification from 'notification'

```