Tenary operator : Conditional Operator : Operators JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Operators » Conditional Operator »

 

Tenary operator

















<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
var w = 1, x = 2, y = 3, z = 4, ans;
ans = (w > x? y : z
alert(ans);
//  -->
</script>
</head>
<body>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Operators
» Conditional Operator