Jump to content
php.lv forumi
  • 0

Javascript function


goma smile

Question

Piemērs tieši no: https://www.npmjs.com/package/is-online

 

 

Apakša ExpressJs:

 

var isOnline = require('is-online');
 
isOnline(function(erronline) {
    console.log(online);
    //=> true 
});
 

 

 

 
ieliekot šo routes viss iet konsolē atgriež true vai false...
 
bet kā man pārrakstīt šo funkciju lai es viņu varētu lietot kā mainīgo..
 
piemēram

var networkStatuss = isOnline(function(err, online) {
    return online;
});



console.log(networkStatuss) // Atgriež undefined
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...