Skip to content

Instantly share code, notes, and snippets.

@selahlynch
Created November 18, 2013 22:25
Show Gist options
  • Save selahlynch/7536472 to your computer and use it in GitHub Desktop.
Save selahlynch/7536472 to your computer and use it in GitHub Desktop.
immediate function example
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
today = new Date(),
msg = 'Today is ' + days[today.getDay()] + ', ' + today.getDate();
alert(msg);
//////////////////////////////////////////////////////////////////
(function () {
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
today = new Date(),
msg = 'Today is ' + days[today.getDay()] + ', ' + today.getDate();
alert(msg);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment