title: How to call a javascript object in one js from the other js file?
body: <p>I have an image on my frontend. I am storing the right click image coordinates in a javascript object. On the other hand I have made an api using nodejs and I want to display this object when I call it through the api, on the web browser. The name of the object is imageCoord. Here is my nodejs code:</p>
  
  <pre><code>console.log('server is starting');
  
  var express = require('express');
  
  var app = express();
  
  var server = app.listen(3000, listening);
  
  function listening() {
      console.log('Listening...');
  }
  
  app.use(express.static('website'));
  
  app.get('/imgcoords', sendImgCoords);
  
  function sendImgCoords(request, response){
      response.send(imageCoord);      
  }
  </code></pre>
  
  <p>I am trying to call the object in the callback function just by its name as this object is a global variable in my frontend code but I am getting a reference error. How can I call this object into this code so that I can get the desired result?</p>