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 

+ Answer
+ Report
Total Preview: 2235

Copyright © 2024. Powered by Intellect Software Ltd