1. Question: What will produce the output of the following code?
    var computer=[“Dell”,”Gateway”,”Apple”,”IBM”,”HP”];
     alert(computer.slice(2,4));

    A
    Apple, IBM

    B
    Dell, Gateway

    C
    Gateway, IBM

    D
    Gateway, HP

    Note: Not available
    1. Report
  2. Question: Which of the following is/are not conversion function(s) in javaScript

    A
    parseInt()

    B
    parseFloat()

    C
    parseString()

    D
    toString()

    Note: Not available
    1. Report
  3. Question: Consider the following JavaScript validation function:
    <script type="text/JavaScript">
    function ValidateField()
    {
            if(document.forms[0].txtId.value =="")
                    {return false;}
    
            return true;
    }
    </script>
    Which of the options will you use for calling this function as soon as the user leaves the field?

    A
    <input name=txtId type="text" onreset="return ValidateField()">

    B
    <input name=txtId type="text" onfocus="return ValidateField()">

    C
    <input name=txtId type="text" onsubmit="return ValidateField()">

    D
    <input name=txtId type="text" onblur="return ValidateField()">

    Note: Not available
    1. Report
  4. Question: What is the output of following JavaScript code?
    <script type="text/javascript">  
      var text = "This is a text";  
      var result = text.split(" "); 
       document.write(result); 
    </script>

    A
    This is a text

    B
    This,is,a,text

    C
    This is a text

    D
    "This" "is" "a" "Text"

    Note: Not available
    1. Report
  5. Question: What is the output of following JavaScript code?  
    <script type="text/javascript">   
     var s= "Good 100%";  
     var pattern = /\D/g;   
     var output= s.match(pattern);  
     document.write(output); 
    </script>

    A
    100%

    B
    Good%

    C
    Good

    D
    G,o,o,d, ,%

    Note: Not available
    1. Report
  6. Question: What is the output of following JavaScript code?  
    <script type="text/javascript">   
    var text="This is a text";   
    alert(text.charAt(text.length-1));
     </script>

    A
    t

    B
    x

    C
    error

    D
    none

    Note: Not available
    1. Report
  7. Question: What is the output of following JavaScript code?
    <script type="text/javascript">   
    document.write(2+5+"8"); 
    </script>

    A
    78

    B
    15

    C
    258

    D
    error

    Note: Not available
    1. Report
  8. Question: What will produce the output of following JavaScript code?
    <script type="text/javascript">
    
      document.write(parseFloat(9+10));
    
    </script>

    A
    19

    B
    19.00

    C
    910

    D
    error

    Note: Not available
    1. Report
  9. Question: What is the output of following JavaScript code?
    <script type="text/javascript">
    
    function sum(x){
       function add(y){
         return x+y;
       }
       return add;
    }
    
    function callme(){
      result=sum(5)(5);
      alert(result);
    }
    
    callme();
    
    </script>

    A
    10

    B
    5

    C
    error

    D
    none

    Note: Not available
    1. Report
  10. Question: What will be the output of following JavaScript code?  
    <script type="text/javascript">  
        var text = "This is a text";   
        var pattern = /is/;  
        var output= text.search(pattern);
        document.write("Position: " + output); 
    </script>

    A
    Position:2

    B
    Position:6

    C
    Position:

    D
    error

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd