Phạm Công Thành
New member
What will be the output of the following JavaScript code?
A. 8
B. 9
C. 3
D. -1
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>
B. 9
C. 3
D. -1