JavaScript Multiple Choice Questions

31.Which of the following function of Array object applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value?

A - pop()
B - reduce()
C - push()
D - reduceRight()

View Answer

32. What is the output of following Javascript?
var a = 'letsfind';
var b = 'course';
var c = a/b;

A. letsfindcourse
B. letsfind/course
C. NaN
D. None of the above

View Answer

33. How ++ works in Javascript? Find output of below Javascript code.
var a = 1;

A. 00
B. 01
C. 11
D. 10

View Answer

34. Find output of below Javascript addition code
document.write("1 plus 1 is " + 1 + 1);

A. 2
B. 1 plus 1 is 2
C. 1 plus 1 is 11
D. 1 plus 1 is 1 + 1

View Answer

35.In JavaScript, Arrays are data type. State True or False

A. True
B. False

View Answer

36. Does JavaScript allow exception handling?

A. Yes, it provides try, catch as well as throw key word for exception handling
B. Yes, but it provides only try block
C. Yes, but it provides only Try catch block, but does not allow throw exception
D. No

View Answer

37. Which of the following method checks if its argument is not a number?

A. isNaN()
B. nonNaN()
C. NaN()
D. None of the above

View Answer

38. What if you use parseInt() to convert a string containing decimal value?

A. Throws Error
B. It returns the decimal values in string form
C. If returns only the integer portion of the number
D. None of the listed option

View Answer

39. What is the output of below Javascript code?
alert (typeof new Date() );

A. Throws Error
B. object
C. Displays Nothing
D. Current Date

View Answer

40. What if we put ++ operator inside if condition? find the output of below code
< script>
var a = 10;
if(a == a++)

A. Error
B. Nothing is printed
C. 10
D. 11

View Answer

Also check :


* You must be logged in to add comment.