title: Javascript practice test question: anonymous functions
body: <p>The following is a practice question for a Javascript exam followed by the answer.</p>
  
  <p>I am confused because my initial reaction was to choose B. I understand that D is also correct, but when I am taking timed exams I will sometimes stop reading the rest of the answers if I find what I believe is a correct answer (depending on how confident I am it is correct). In this case, I was supremely confident that B was a correct answer.</p>
  
  <p>I am still trying to figure out why I was wrong for picking B, and the "answer" only seems to confirm my choice. Am I taking crazy pills (i.e. how am I misreading this???)? Or is this just a mistake in the book I'm reading?</p>
  
  <blockquote>
    <ol start="2">
    <li><p>Which of the following isn’t an attribute of an anonymous function?</p>
  
  <pre><code>A. Anonymous functions can’t be called by any other code.
  B. Anonymous functions have a clearly defined name.
  C. Anonymous functions can be passed as parameters.
  D. Anonymous functions can’t be assigned to a DOM element declaratively
  </code></pre></li>
    </ol>
    
    <p></p>
    
    <ol start="2">
    <li><p>Correct answer: D</p>
  
  <pre><code>A. Incorrect: Anonymous functions can’t be called.
  B. Incorrect: Anonymous functions don’t have a name.
  C. Incorrect: Anonymous functions can be passed as parameters.
  D. Correct: Anonymous functions can’t be assigned to a DOM element declaratively.
  </code></pre></li>
    </ol>
  </blockquote>