MCQ 1 What is the correct syntax for referring to an external script called "abc.js"?
MCQ 2 Which of the following is not considered as an error in JavaScript?
MCQ 3 What will be the output of the following JavaScript code?
int a==2; int b=4; int ans=a+b; print(ans);
MCQ 4 What is the output of the follwing code .
<script type="text/javascript">
a = 8 + "8";
document.write(a);
</script>
MCQ 5 Which of the following is not a reserved word in JavaScript?
MCQ 6 Which of the following are the errors in JavaScript?
MCQ 7 What is the correct JavaScript syntax to write "Welcome to the Universal Portal for Education KNOWLEDGE UNIVERSE ONLINE"?
MCQ 8 Inside which HTML element do we put the JavaScript?
MCQ 9 Scripting language are
MCQ 10 Which of the following event fires when the form element loses the focus: <button>, <input>, <label>, <select>, <textarea>?
MCQ 11 Which best explains getSelection()?
MCQ 12 What is the output of the following code?
<script type="text/javascript">
x=7+"7";
document.write(x);
</script>
MCQ 13 What will be the output?
const pi=3.14;
var pi=4;
console.log(pi);
MCQ 14 If an operator is NaN or converts to NaN, what wil comparison operator always returns ?
MCQ 15 What is the full form DOM?
MCQ 16 Which of the following is the descendant operator?
MCQ 17 In JavaScript, Window.prompt() method return true or false value ?
MCQ 18 What should appear at the very end of your JavaScript? The <script language="javascript"> tag
MCQ 19 What will be the output of the below code?
let chaval= (p)=>p+2;
console.log(chaval(2));
MCQ 20 How do we define the term Thread?
MCQ 21 Which one is a ternary operator in JavaScript?
MCQ 22 What will be the output of the below code?
class Rect {
constructor(h, w) {
this.height = h;
this.width = w;
}
get foo() {
return this.foo();
}
foo() {
return this.height * this.width;
}
}
const sq = new Rect(5, 20);
console.log(sq.foo());
MCQ 23 What will be printed in the console on execution of the following JS code:
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
var myArr= array.filter(v => v % 3 === 0);
console.log(myArr);
MCQ 24 In JavaScript, a _____________ is an object of the target language data type that encloses an object of the source language.
MCQ 25 What are the types of Pop up boxes available in JavaScript?
MCQ 26 what will be the output of below code?
var todaysDate = new Date()
console.log( todaysDate.toLocaleString() );
MCQ 27 How do you find the minimum of x and y using JavaScript?
MCQ 28 Choose the server-side JavaScript object?
MCQ 29 Consider the below code:
Identify the correct code in order to fetch the value entered in username text field?
<body>
<form name="register">
Enter username <input value="Rajiv" id="name" name="username">
</form>
</body>
MCQ 30 What will be the output of the following JavaScript code?
<p id="demo"></p>
<script>
var a = 20;
var b = "30";
var c = a + b;
document.getElementById ("demo").innerHTML = c;
</script>
MCQ 31 What will be the output of the below code ?
var i=true;
var j=false;
var k=true;
if( i || J && K){
a=10;
b="True";
}
else {
a=20;
b="False";
}
console.log(a+","+b);