Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript js ternary operater

<script>  
    function gfg() {  
     //JavaScript to illustrate 
    //Conditional operator 
  
    let PMarks = 40 
    let result = (PMarks > 39)? 
        "Pass":"Fail"; //Syntax:- (condition) ? do this if true : do this if false
  
    document.write(result); 
    }  
    gfg();  
</script>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #javascript #js #ternary #operater
ADD COMMENT
Topic
Name
9+6 =