How to Create a Web Page using JavaScript Practice Test - Set 03 - ObjectiveBooks

How to Create a Web Page using JavaScript Practice Test - Set 03

Practice Test: Question Set - 03


1. How many different values can be returned by the error name property in JavaScript?
    (A) 3
    (B) 4
    (C) 5
    (D) 6

2. What is the abbreviation of W3C in Dom?
    (A) World Wide Web Curricula
    (B) World Wide Web Consortium
    (C) World Wide Web Centre
    (D) World Wide Web Content

3. Which single character escape sequence represents 'line feed' JavaScript?
    (A) " b"
    (B) " f"
    (C) " n"
    (D) " t"

4. Which error indicates that the variable used is not declared?
    (A) Eval Error
    (B) Range Error
    (C) Reference Error
    (D) Syntax Error

5. Which variable declared outside a function in JavaScript?
    (A) Function variable
    (B) Global variable
    (C) Local variable
    (D) Object variable

6. Which is property returns the URL of the current page?
    (A) href()
    (B) < herf >
    (C) Location.herf
    (D) herf.location

7. What will be the output, if the JavaScript code is executed?
     var x = 1324;
     var y = new Number(1324);
     if( x === y)
     alert(‘Yes’);
     else
     alert(‘No’)
    (A) Infinity
    (B) Error
    (C) No
    (D) Yes

8. Which programming language’s syntax influences JavaScript syntax?
    (A) C
    (B) COBOL
    (C) Java
    (D) JDK

9. Which object method is used to return the value rounded down to its nearest integer?
    (A) abs()
    (B) ceil()
    (C) floor()
    (D) round()

10. What is the main purpose of JavaScript?
    (A) Client side validation
    (B) Create web browsers
    (C) Read and write files
    (D) Store data in the server

11. Which keyboard in switch case statement specifies the code to run if there is no case match?
    (A) Break
    (B) Case
    (C) Default
    (D) End

12. Which method removes the last elements from an array?
    (A) Join()
    (B) Push()
    (C) Pop()
    (D) Shift()

13. How will JavaScript treat a number, when it is enclosed with double or single quotes?
    (A) Error
    (B) Number
    (C) String
    (D) Zero

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests: