Learn, Share, Build

241
October 13, 2017, at 11:24 PM

I create a function in Node.js I want to return value from it and want to get value when I call this function.

This is my function

module.exports = {
  pdfDownload :function()
  {
    return true;
  }
}

Now This is another file where I call this function

var objpdfApi = require('./pdfapi.js');
 var abc = objpdfApi.pdfDownload()
 console.log(abc)

but It give result "undefined"

I am following this Javascript concept

https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_state_return_pi

Now what should I do for returning value??

Rent Charter Buses Company
READ ALSO
Learn, Share, Build

Learn, Share, Build

I am trying to set up a development environment for my new project

211
Learn, Share, Build

Learn, Share, Build

This question already has an answer here:

230
Learn, Share, Build

Learn, Share, Build

I have created login page and for accessing data I have used JSON Filewhen I click on the login() btn , userdata should match with the server data

279
Learn, Share, Build

Learn, Share, Build

I have a highlight hover map built in JavaScript that shows a div 'info box' when I hover a certain area @ https://isidorscom/test/dupex/contact The problem is that my 'info box' div element does not seem to appear at the exact mouse location, as desired,...

296