Você está na página 1de 4

Question# 1:

JavaScript is ECMAScript

1. False
2. True
3. May be
4. All of the above
Correct Answer: True
Question# 2:

Variable in JavaScript declared with which of the following keyword?

1. new
2. int
3. string
4. var
Correct Answer: var
JavaScript written under which of the following tag?
1. <JavaScript></JavaScript>
2. <script></script>
3. <code></code>
4. <head></head>
Correct Answer: <script></script>
Which of the followings are primitive data types in JavaScript?
1. String
2. Number
3. Boolean
4. All of the above
Correct Answer: All of the above
Which of the following is NOT a JavaScript object?
1. var obj = {};
2. var obj = { name: "Steve"};
3. var obj = { name = "Steve"};
4. var lbj = new Object();
Correct Answer: var obj = { name = "Steve"};
Which of the following is NOT a correct way of declaring an array in JavaScript?
1. var arr = [1, "two", 3 , 4 ];
2. var arr = new Array();
3. var[] arr = new Number(){5];
4. None of the above
Correct Answer: var[] arr = new Number(){5];
What is null in JavaScript?
1. Null means empty string value.
2. Null means absence of a value.
3. Null means unknown value.
4. Null means zero value.
Correct Answer: Null means absence of a value.
Which of the following is a valid JavaScript function?
1. var myFunc = function myFunc(){ };
2. function myFunc(){ };
3. function(){ };
4. function myFunc = { };
Correct Answer: function myFunc(){ };
Which of the following object represent parameters of current function inside
any function?
1. Global
2. arguments
3. this
4. Object
Correct Answer: arguments
A function can be assigned to a variable in JavaScript.
1. True
2. False
3. Some time
4. None of the above
Correct Answer: True
Which of the following is an example of anonymous function in JavaScript?
1. var myFunc = function(){ };
2. function(){ };
3. var myFunc = (){ };
4. All of the above.
Correct Answer: var myFunc = function(){ };
What will 1 == "1" return?
1. True
2. False
3. 0
4. 1
Correct Answer: True
What is eval() in JavaScript?
1. It executes specified string as JavaScript code.
2. It parses string as JavaScript code.
3. It executes server side code in JavaScript.
4. It displays popup message.
Correct Answer: It executes specified string as JavaScript code.
How to handle error in JavaScript?
1. By writing error proof code.
2. By using eval().
3. By using if-else block
4. By using try, catch & finally block.
Correct Answer: By using try, catch & finally block.
How to apply strict mode in JavaScript?
1. "strict mode"
2. "strict"
3. "use strict"
4. "apply strict"
Correct Answer: "use strict"
A variable declared without var keyword inside a function will become _______
variable.
1. local
2. global
3. block
4. undefined
Correct Answer: global
Which of the following is not a valid keyword in JavaScript?
1. function
2. this
3. class
4. try
Correct Answer: class
What will be the output of the following JavaScript code?
x = 1;
console.log('x = ' + x);
var x;

1. x=1
2. error: x is undefined
3. x = undefined
4. x = null;
Correct Answer: x = 1
What will be the output of the following JavaScript code?
for(var x = 1; x < 5; x++)
console.log(x);

1. 11111
2. 12345
3. 1234
4. 5555
Correct Answer: 1234
What will be the output of the following JavaScript code?
var x = 0
do{ console.log(x) }while(x > 0)

1. 0
2. null
3. 1
4. No output
Correct Answer: 0

Você também pode gostar