0% found this document useful (0 votes)
17 views

Javascript Test

This document contains a quiz with multiple choice questions testing JavaScript fundamentals like data types, operators, functions, arrays and more. There are 24 questions in total covering concepts around syntax, output, order of operations and evaluating expressions.

Uploaded by

farrukh.jeans12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Javascript Test

This document contains a quiz with multiple choice questions testing JavaScript fundamentals like data types, operators, functions, arrays and more. There are 24 questions in total covering concepts around syntax, output, order of operations and evaluating expressions.

Uploaded by

farrukh.jeans12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1st Pre-Test Grand Quiz

1. I created a file script.js. I added it in HTML document and then I start adding code in
script.js like
<script>
alert(“Hello
Hello World
World”);
</script>
Am I doing something rightright?
2. What will be the possible output
output/outputs of the following code:
2 % console.log(20 % 6);
3. What will be the possible output
output/outputs of the following snippet, If I input -3
console.log(-prompt());
4. What will be the output of the following:

5. What could be the answer of this:

(true + false) > 2 + true


true;

6. What will be output of the following code:

7. What will be the answer of this code:


"1" - - "1";
8. Possible output ?
[] + [] + 'foo'.split('');
9. What will be the output ?
new Array(5).toString()
10. Possible output of the following:

11. Possible output:


"This is a string" instanceof String;
12. What will be the outputput of the following:

13. What can be the output:


10 > 9 > 8 === true;
14. Possible output of the follow
llowing:
var foo = function foo() {
console.log(foo === foo);
};
foo();
15. Possible output:
function makeAdder(amount) {
return function(number) {
return number + amount;
};
}
var addTwo = makeAdder(2);
alert(addTwo(3));
16. Possible output:
var false = new Boolean(false
false);
If(false){
console.log(“II am false
false”);
}
else{
console.log(“II am truthy
truthy”);
}
17. Possible Output:
If(true % 1){
console.log(“II am false
false”);
}
else{
console.log(“II am truthy
truthy”);
}
18. Possible outputs:
function someName(a,b,c){{
return typeof arguments;
}
someName(1,2,3);
19. Possible outputs:
function someName(a,b,c){{
arguments.push(1,2,3,4,5,6
1,2,3,4,5,6);
arguments.pop();
return arguments;
}
20. If you have var y = 1, x = y = typeof x x; What is the value of x?
21. for var a = (1, 5 - 1) * 2 what is the value of a?
22. What is -5%2
23. Swap 2 variables without the help of 3rd variable. var a = 2; var b = 5; Output: a = 5, b= 2
24. What will be the output of this codecode:

You might also like