Đàm Ngọc Lan
New member
What will be the output of the following JavaScript code?
A. true
B. false
C. error
D. undefined
Code:
<p id="demo"></p>
<script>
function myFunction()
{
var str = "Is this his";
var patt1 = /is$/g;
var result = str.match(patt1);
if(result)
result='true';
else
result='false';
document.getElementById("demo").innerHTML = result;
}
</script>
B. false
C. error
D. undefined