Skip to content

Instantly share code, notes, and snippets.

@alexdelany
Last active December 11, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexdelany/4624400 to your computer and use it in GitHub Desktop.
Save alexdelany/4624400 to your computer and use it in GitHub Desktop.
function Source(url){
this.url = url;
this.morelinks = ['NO CHANGE'];
this.calculate = function(url){
console.log("Calculating: " + this.url);
console.log('1: ' + this.morelinks)
var parse = function(err,resp,body){
console.log('3: ' + this.morelinks)
this.morelinks.pop("ADDED ONE");
}
request(this.url,parse);
console.log('4: ' + myResults.morelinks)
}
}
@alexdelany
Copy link
Author

here's what the console prints

Calculating: http://www.reddit.com/r/videos
1: NO CHANGE
2: undefined
4: NO CHANGE
Express server listening on port 3000
3: undefined

@alexdelany
Copy link
Author

forgot to include

myResults = new Source('http://www.reddit.com/r/videos');
myResults.calculate();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment