Javascript Mcqs
Q.1: Given a variable named stringVar with a string value, what does the following do? stringVar.toUpperCase();k
A. Alters stringVar, changes all letters to uppercase2
B. Return the number of characters in the stringVar variable9
C. Evaluate any string expression in stringVar+
D. Return a copy of stringVar with all letters in uppercase8
Q.2: Given the next statement, what is the value of 'x' ? var a = true, b = false, x = !(a===b) ? !a : b;p
A. true
B. false
C. No Option
D. No Option
Q.3: Which of the following is not a method in the "JSON" object according to the ECMAScript specification?f
A. JSON.parse
B. JSON.fromString
C. No Option
D. No Option
Q.4: Functions in javascript are always ..%
A. operators
B. loops
C. objects
D. in the global scope
Q.5: Which of the following is the syntax for an object literal (with no properties)?P
A. {};
B. [];
C. {};
D. object;
Q.6: What are curly braces ("{" and "}") used for?-
A. Setting attributes
B. Block declarations and object literals&
C. Block declarations and object literals&
D. Parsing JSON
Q.7: In the loop, "for (first clause; second clause; third clause) { statements; }" What does the second clause represent?u
A. Code to execute once, after the loop has ended.
B. A condition to check at the end of each loop cycle2
C. Code to execute once, before the loop starts,
D. A condition to check at the beginning of each loop cycle8
Q.8: What is the value of x? function foo(y) { var z = 10; z = 7; }; var x = foo("bar"); Z
A. null
B. 10
C. undefined
D. 7
Q.9: How do you write a conditional statement that will only execute the contained code if variable x has a value 5 of type number?
A. if (x === 5) { ... }
B. if (x == 5) { ... }
C. if x = 5 then ...
D. if x = 5 ...
Q.10: If a function doesn't explicitly use the "return" operator, what will the return value be when the function is invoked?w
A. undefined
B. null
C. undefined
D. closure

Related Mcqs

All Subject Mcqs