In pset8, I have thought out 2 solutions for showing the information window when the user clicks on the marker.
google.maps.event.addListener(marker, 'click', function() {
showInfo(marker, articlesContent);
and
google.maps.event.addListener(marker, 'click', showInfo(marker, articlesContent);
why does the former work by the latter not work? I mean isn't showInfo also a function? why do you need to come up with another anonymous function and feed in the showInfo function?
Apologies if this a newbie kind of mistake but I am completely new to Javascript and have been struggling for days for this pset. Would appreciate if someone could help me out!