What will be the output of the following JavaScript code? [code] <p id="demo"></p> <script> function myFunction() { var str = "hello

What will be the output of the following JavaScript code?
Code:
<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "hello to \r world."; 
   var patt1 = /\v/;
   var result = str.search(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>
A. 8
B. 9
C. 3
D. -1
 

Tìm kiếm

Back
Top