Skip to content

Commit

Permalink
Merge pull request FrontendMasters#5 from leonardofed/patch-1
Browse files Browse the repository at this point in the history
only pass a reference to the function
  • Loading branch information
1Marc authored Dec 20, 2018
2 parents f18fbc2 + 96d7846 commit e1b4b77
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ console.log('End of Challenge 5');
//CHALLENGE 6//
console.log('Start of Challenge 6');
var dataReceived;
var data; // is undefined at first

function ajaxSimulate(id, callback) {
var database = ['Aaron', 'Barbara', 'Chris'];
setTimeout(callback(database[id]), 0);
var data = database[id]
setTimeout(callback, 0);
}

function storeData(data) {
Expand Down Expand Up @@ -242,4 +244,4 @@ function dataHandler(data) {
$("#ch4").slice(0, -1); //takes off the extra comma
}

console.log('End of Challenge 9');
console.log('End of Challenge 9');

0 comments on commit e1b4b77

Please sign in to comment.