if (d) {some code} what does it mean?

Discussion in 'JavaScript' started by progfrog, May 17, 2008.

  1. #1
    does it mean that in case d is true then {some code} or what?
    i simply don't know...
    thanks for checking this post out.
     
    progfrog, May 17, 2008 IP
  2. eTechDude.com

    eTechDude.com Member

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    i'm sure it means if variable is active or has data in it (i stand to be corrected)?
    eg:
    
    <script type="text/javascript">
    <!--
    function confirmation() {
    	var answer = confirm("Leave digitalpoint.com?")
    	if (answer){
    		alert("Bye bye!")
    		window.location = "http://www.google.com/";
    	}
    	else{
    		alert("Thanks for sticking around!")
    	}
    }
    //-->
    </script>
    
    Code (markup):
     
    eTechDude.com, May 17, 2008 IP
  3. progfrog

    progfrog Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks man. now i understand!
     
    progfrog, May 17, 2008 IP