JavaScript question: what’s the printed value?

submit to reddit
var a = function() { alert(arguments[0]) } (1,2,3);

What’s the alerted value and how that works?

Related posts:

  1. What make JavaScript closures work?
  2. JavaScript Comparision Snippet
  3. JavaScript Snippets: IF Statements Optimization Part 2

You are a GREAT developer? Click here to answer the weekly quiz!

This entry was posted in javascript and tagged , . Bookmark the permalink.

3 Responses to JavaScript question: what’s the printed value?

  1. Stoimen says:

    By the way, what’s the value of the variable a?

  2. Georgi Mitev says:

    should be “1″ :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">