I am developing Node Js application using get-proxylist library so my question is how to get the value which is inside the function here is my code:
var proxylist = require('get-proxylist');
var array =[]
 proxylist(function(error, result){
        for(var i = 0; i < result.length; i++) {
            array.push(result[i]);
        }
    })
console.log(array[0]) // display undefined
 
    