Question: **This is common.js**

```
jQuery(function ($) {

    var commonJs = {
        init: function () {
        },
        showAlert: function () {
        },

    }

});

```

**This is add.js**

```
jQuery(function ($) {

    var addJs = {
        init: function () {
            console.log(commonJs.showAlert);
        },
    }

});

```

I want to use common js function **commonJs.showAlert** in add.js

How can i access that?

Answer: 
```
var commonJs;
jQuery(function ($) {

    commonJs = {
        init: function () {
        },
        showAlert: function () {
        },

    }

});

```

I just had to put this variable outside **jQuery(function ($)** and it worked.
Please simply place commonJs var outside the jQuery function and try again. It will work for you.