Question-1: Analyze the following
code snippet. What will be the output of this code?
<html>
<body>
<script type="text/javascript">
var str = "The drain of the plane is plain";
var patt1 =/ain/g;
document. Write(str.match(patt1));
</script>
</body>
</html>
a. 1
b.
ain
c.
7,29
d. 7
Answer : e. ain,ain
Question-2: Which of the
following is the correct syntactical representation of a generator expression
in JavaScript?
a.
var doubles = [i * 2 for (i in it)];
b.
var doubles = [i * 2 for [i in it]];
Answer:...