1. Question:Why is Objected Oriented Programming? 

    Answer
    1. For working with more people on web project using javaScript and the scripts become longer,OOP becomes more important.
    2.Because OOP encourages modular program units, the units can be shared with others on a programming team and can be reused.






    1. Report
  2. Question:What is Operator Precedence? 

    Answer
    The order in which expressions are evaluated based on their operators is known as precedence. For example, multiplication and division occur before addition and subtraction, so any operands that are to be multiplied or divided occur before ones that are added and subtracted.






    1. Report
  3. Question:Briefly describe the new, delete and void operators

    Answer
    New operator:All objects must begin with a constructor preceded by the new operator.
    Example:
    var family=new Array("Dad","Mom","Sue","Kris");
    Delete operator:The delete operator removes an object property or an array element in a script. Example:
    var family=new Array("Dad","Mom","Sue","Kris");
    delete family[2];
    Void Operator:Void operator is unary and operates on any literal or variable.Usually, we will see this operator as part of an <A> tag in an HTML script. Example:
    <a href="javascript:void(0)" onClick="scroll(500,0)">






    1. Report
  4. Question:Define a function to sum up any number of numbers. 

    Answer
    <script>
            function add(...numbers){
                 
              let total=0;
              for(let n of numbers){
                  total+=n;
              }
                 return total;
            }
    
            document.write(add(3,4,3,5,7,3,23,7));
        </script>






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd