vendredi 17 février 2017

RandomORG API in NodeJS returning undefined values

As the title says, I'm trying to use the RandomORG API to generate (true)random numbers, the only thing whenever I try to generate a random number in my NodeJS it returns undefined.

This is how I do it:

    var RandomOrgAPI = require('random');
    var die;

    //Here I log a random integer to the console.
    console.log("" + RandomOrgAPI.integer({min:1,max:5,num:1},function(result){console.log(die = result[0])}));




Aucun commentaire:

Enregistrer un commentaire