The value FALSE is not a constant for the number 0, it is a boolean value that indicates FALSE.  The value TRUE is also not a constant for 1, it is a special boolean value that indicates TRUE.  It just happens to cast to integer 1 when you print it or use it in an expression, but it's not the same as a constant for the integer value 1 and you shouldn't use it as one.

A boolean expresses a truth value. It does not say "a boolean expresses a 0 or 1".

The symbolic constants are specifically designed to always and only reference their constant value.  But booleans are not symbolic constants, they are values.

Related Posts:

  • Why we are using $(document).ready(function() in jquery? This is used to restrict any jQuery code from running before the document is finished loading or document is ready. It is good practice to wait for the document to be fully loaded and ready before working with it. This als… Read More
  • Use of callback function in JQuery JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This will cause to trigger the errors. To prevent this, you can create a cal… Read More
  • 15 Essential CSS Questions: 1. Which of the following is NOT a valid border-style property value? dotted inset glazed groove solid  Ans:  glazed   2. Which of the following is NOT a valid CSS length unit? cm dm em mm Ans: dm cm… Read More
  • How to run the multiple jquery methods within a single statement In JQuery, this activity is called as chaining which means you can chain together actions/methods. Below snippet is the example of Jquery Chaining. <script>$(document).ready(function(){    $("button").c… Read More
  • Examples of JQuery Selectors jQuery selectors are used to "find" (or select) HTML elements based on their id, classes, types, attributes, values of attributes and much more. All selectors in jQuery start with the dollar sign and parentheses: $(). Th… Read More

0 comments:

Blog Archive

Total Pageviews

15581

Popular Posts