Javascript Mixed(Computer Science > Javascript ) Questions and Answers
Question 1. Indicates the beginning and the end of a JavaScript section
Explanation:-
Answer: Option A. ->
Question 2. State the correct place of JS Code inside HTML -
Inside Body
Inside Head
Inside Single JavaScript File
All of these
Explanation:-
Answer: Option D. -> All of these
Question 3. Assignment Operators is following type of operator ______________
Binary
Unary
Ternary
None of these
Explanation:-
Answer: Option A. -> Binary
Question 4. Which of the following operator is used for the Assignment Operator?
==
!
=
+
Explanation:-
Answer: Option C. -> =
Question 5. Which of the following is NOT a valid component of a function declaration?
Function keyword
Function name
Pair of Square Braces
Pair of Curly Braces
Explanation:-
Answer: Option C. -> Pair of Square Braces
Question 6. This saves a value, which can be then assigned when writing code
Parameter
Function
Variable
none of the above
Explanation:-
Answer: Option C. -> Variable
Question 7. Which of the following is the correct syntax to redirect a url using JavaScript?
document.location='http://www.newlocation.com';
browser.location='http://www.newlocation.com';
navigator.location='http://www.newlocation.com';
window.location='http://www.newlocation.com';
Explanation:-
Answer: Option D. -> window.location='http://www.newlocation.com';
Question 8. Which of the following function of String object returns the index within the calling String object of the first occurrence of the specified value?
substr()
search()
lastIndexOf()
indexOf()
Explanation:-
Answer: Option D. -> indexOf()
Question 9. Var num;Above Statement is called as __________ Statement
Instantization
Globalization
Declaration
Initialization
Explanation:-
Answer: Option C. -> Declaration
Question 10. Inside which HTML element do we put the JavaScript?