Web Analytics Made Easy -
StatCounter Help with "value of selected" - CodingForum

Announcement

Collapse
No announcement yet.

Help with "value of selected"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with "value of selected"

    I'm trying to figure out this code, and unfortunately the book I'm using isn't explaining this in a way that makes sense to me. Any help is much appreciated.

    What is the value of selected when the following code executes?
    var num = "3.5";
    var selected = num && parseFloat(num) || num || "";

  • #2
    have you executed the code? what did it return?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

    Comment

    Working...
    X