JavaScript Test: GK Quiz! Trivia

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Tannu
T
Tannu
Community Contributor
Quizzes Created: 1 | Total Attempts: 7,610
Questions: 11 | Attempts: 7,610

SettingsSettingsSettings
JavaScript Test: GK Quiz! Trivia - Quiz

JavaScript is a programming language that enables you to carry out complex items on web pages. It's a scripting language that helps create rich, updated content, including multimedia, animated images, graphics, etc. Javascript was developed to make web pages live, also known as "Live Script." This quiz will test your knowledge about the functions and basics of Javascript.


Questions and Answers
  • 1. 

    JavaScript File Has An Extension of:

    • A.

      .Java

    • B.

      .Js

    • C.

      .javascript

    • D.

      .xml

    Correct Answer
    B. .Js
    Explanation
    The correct answer is ".Js" because in JavaScript, the file extension is typically ".js". This extension is used to identify files that contain JavaScript code. By convention, JavaScript files are saved with this extension to make it clear that they contain JavaScript code that can be executed by a JavaScript engine. Other file extensions listed in the options such as ".Java", ".javascript", and ".xml" are not commonly used for JavaScript files.

    Rate this question:

  • 2. 

    The ____________ Tag is used To Give Heading To The Table.

    • A.

      Head

    • B.

      Td

    • C.

      Th

    • D.

      Caption

    Correct Answer
    D. Caption
    Explanation
    The correct answer is "caption". In HTML, the "caption" tag is used to give a heading to the table. It is placed immediately after the opening "table" tag and before the "tr" and "td" tags. The "caption" tag helps provide a title or description for the table, making it easier for users to understand its content or purpose.

    Rate this question:

  • 3. 

    IsNaN() Evaluates And Argument To Determine if Given Value:

    • A.

      Is Not a Null

    • B.

      Is Not a Number

    • C.

      Is Not a New Object

    • D.

      None Of The Above

    Correct Answer
    B. Is Not a Number
    Explanation
    The function isNaN() evaluates an argument to determine if the given value is not a number. It checks whether the argument is a numeric value or can be converted into one. If the argument is not a number, the function returns true; otherwise, it returns false.

    Rate this question:

  • 4. 

    Function is Used To Parse a String To Int:

    • A.

      Integer.Parse

    • B.

      Int.Parse

    • C.

      Parse.Int

    • D.

      None

    Correct Answer
    B. Int.Parse
    Explanation
    Int.Parse is the correct answer because it is a function used to convert a string representation of a number into its integer equivalent. It takes a string as input and returns the integer value. This function is commonly used in programming to convert user input or data stored as strings into integers for mathematical operations or other purposes.

    Rate this question:

  • 5. 

    Which Of The Dialog Box Display a Message And a Data Entry Field?

    • A.

      Alert()

    • B.

      Prompt()

    • C.

      Confirm()

    • D.

      Msg()

    Correct Answer
    B. Prompt()
    Explanation
    The prompt() function displays a dialog box that contains a message and a data entry field. This allows the user to enter information or provide a response to the prompt. The other options (alert(), confirm(), and msg()) do not display a data entry field, making prompt() the correct answer.

    Rate this question:

  • 6. 

    Event is Used To Check An Empty Text Box:

    • A.

      Onclick()

    • B.

      OnFocus()

    • C.

      OnBlur()

    • D.

      None

    Correct Answer
    C. OnBlur()
    Explanation
    The onBlur() event is used to check if a text box is empty. This event is triggered when the user moves away from the text box, indicating that they have finished entering text. By using the onBlur() event, developers can validate the input and display an error message if the text box is empty. The other options, onclick() and onFocus(), do not specifically check for an empty text box. Therefore, the correct answer is onBlur().

    Rate this question:

  • 7. 

    Method Prompt() Contain ........Number of Parameters.

    • A.

      One

    • B.

      Two

    • C.

      Three

    • D.

      Zero

    Correct Answer
    B. Two
    Explanation
    The method Prompt() contains two parameters.

    Rate this question:

  • 8. 

    GetMonth() returns The Month as:

    • A.

      Int

    • B.

      Float

    • C.

      Char

    • D.

      String

    Correct Answer
    A. Int
    Explanation
    The getMonth() function in programming languages such as Java or JavaScript returns the month as an integer. This means that the function will provide the numerical representation of the month, typically ranging from 0 to 11, where 0 represents January and 11 represents December. Using an integer to represent the month allows for easier manipulation and comparison of dates within a program.

    Rate this question:

  • 9. 

    If Button is clicked .......Event Handler is invoked.

    • A.

      OnSubmit()

    • B.

      OnLoad()

    • C.

      IsPostBack()

    • D.

      Onclick()

    Correct Answer
    D. Onclick()
    Explanation
    When a button is clicked, the event handler associated with it is invoked. In this case, the correct answer is "Onclick()" because it is the event that is triggered when the button is clicked. The other options, "OnSubmit()", "OnLoad()", and "IsPostBack()" are not relevant in this context as they are not specific to button clicks.

    Rate this question:

  • 10. 

    A Function Associated With An object is Called:

    • A.

      Function

    • B.

      Method

    • C.

      Link

    • D.

      None

    Correct Answer
    B. Method
    Explanation
    A function associated with an object is called a method. In object-oriented programming, a method is a behavior that an object can perform. It is defined within a class and can access and manipulate the data of the object it belongs to. Methods are used to encapsulate related functionality and provide a way to interact with objects. They are called using the dot notation, where the object name is followed by the method name.

    Rate this question:

  • 11. 

    Inside which HTML element do we put the JavaScript?

    • A.

      Js

    • B.

      JavaScript

    • C.

      Script

    • D.

      Scripting

    Correct Answer
    C. Script
    Explanation
    JavaScript code is typically placed within the <script> element in HTML documents. This element is used to define client-side JavaScript code that interacts with the HTML content of a webpage. It can be placed either in the <head> or <body> section of the HTML document.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Apr 03, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 21, 2008
    Quiz Created by
    Tannu
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.