Javascript Multichoice Basic Flashcards
function aaa() { return {test: 1}} alert(typeof aaa()); What does the above alert return
undefined
(true + false) > 2 + true;
What is the result
false
function bar() { return foo; foo = 10; function foo() {} var foo = '11'; } alert(typeof bar());
what is alerted?
function
Q 1 - Which of the following is correct about JavaScript?
A - JavaScript is a lightweight, interpreted programming language.
B - JavaScript has object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages.
C - The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.
D - All of the above.
D
Q 2 - Which of the following is correct about features of JavaScript?
A - JavaScript is a lightweight, interpreted programming language.
B - JavaScript is designed for creating network-centric applications.
C - JavaScript is complementary to and integrated with Java.
D - All of the above.
D
Q 4 - Which of the following is an advantage of using JavaScript?
A - Less server interaction
B - Immediate feedback to the visitors
C - Increased interactivity
D - All of the above.
D
Q 5 - Which of the following is a disadvantage of using JavaScript?
A - Client-side JavaScript does not allow the reading or writing of files.
B - JavaScript can not be used for Networking applications because there is no such support available.
C - JavaScript doesn’t have any multithreading or multiprocess capabilities.
D - All of the above.
C
*Q 6 - Is JavaScript a case-sensitive language?
A - true
B - false
A
Q 7 - Which of the following is true about variable naming conventions in JavaScript?
A - You should not use any of the JavaScript reserved keyword as variable name.
B - JavaScript variable names should not start with a numeral (0-9).
C - Both of the above.
D - None of the above.
C
Q 8 - Which of the following is true about variable naming conventions in JavaScript?
A - JavaScript variable names must begin with a letter or the underscore character.
B - JavaScript variable names are case sensitive.
C - Both of the above.
D - None of the above.
C
Q 9 - Which of the following is true about typeof operator in JavaScript?
A - The typeof is a unary operator that is placed before its single operand, which can be of any type.
B - Its value is a string indicating the data type of the operand.
C - Both of the above.
D - None of the above.
C
Unary: In computer programming, a unary operator is an operator that takes only one value for its operation. An example in the C programming language is the increment operator (++), which increments a given value by 1.
Q 10 - Can you access Cookie using javascript?
A - true
B - false
A
Q 11 - Which of the following is true about cookie handling in JavaScript?
A - JavaScript can manipulate cookies using the cookie property of the Document object.
B - JavaScript can read, create, modify, and delete the cookie or cookies that apply to the current web page.
C - Both of the above.
D - None of the above.
C
Q 12 - Which of the following is the correct syntax to create a cookie using JavaScript?
A - document.cookie = ‘key1 = value1; key2 = value2; expires = date’;
B - browser.cookie = ‘key1 = value1; key2 = value2; expires = date’;
C - window.cookie = ‘key1 = value1; key2 = value2; expires = date’;
D - navigator.cookie = ‘key1 = value1; key2 = value2; expires = date’;
A
Q 13 - Which of the following is the correct syntax to redirect a url using JavaScript?
A - document.location=’http://www.newlocation.com’;
B - browser.location=’http://www.newlocation.com’;
C - navigator.location=’http://www.newlocation.com’;
D - window.location=’http://www.newlocation.com’;
C