JavaScript Basic Knowledge Test! Trivia Questions Quiz

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 BayanRadaideh
B
BayanRadaideh
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,084
Questions: 11 | Attempts: 1,085

SettingsSettingsSettings
JavaScript Basic Knowledge Test! Trivia Questions Quiz - Quiz

Are you looking to test out your JavaScript Basic Knowledge? This test is perfect for all computer students who have just begun learning this language that has been used in creating end-user experiences in web browsers. Do you know how to handle error in Java and the data models? Do take this quiz and see what more you may learn.


Questions and Answers
  • 1. 

    Java Script 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 files that contain JavaScript code typically have a file extension of .js. This convention helps to identify and differentiate JavaScript files from other types of files in a project.

    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 provide a title or heading to a table. It is typically placed right after the opening table tag and before the opening tr tag. The content within the caption tag is displayed centered above the table, providing a brief description or title for the table.

    Rate this question:

  • 3. 

    IsNaN() Evalutes 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 correct answer is "is Not a Number". The isNaN() function is used to evaluate an argument and determine if it is not a number. It returns true if the argument is not a number and false if it is a number. This function is commonly used to check if a value is a valid number before performing mathematical operations on it.

    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 parse a string to an integer in many programming languages, including C#. It takes a string as input and converts it into an integer value. This function is commonly used when we need to convert user input or data from a file, which is in string format, into an integer for further calculations or processing.

    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() dialog box displays a message and a data entry field. It is commonly used to prompt the user for input or to get a value from the user. This dialog box allows the user to enter text or numeric values and returns the value entered by the user. The other options, such as alert(), confirm(), and msg(), do not include a data entry field and are used for displaying messages or getting a yes/no response from the user.

    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 an empty text box. This event is triggered when the user moves away from the text box after entering some value. It is commonly used to validate user input and ensure that required fields are not left empty. The onBlur() event can be used to display an error message or perform any other action when an empty text box is detected.

    Rate this question:

  • 7. 

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

    • A.

      One

    • B.

      Two

    • C.

      Three

    • D.

      Zero

    Correct Answer
    B. Two
    Explanation
    The correct answer is "Two" because the prompt() method in programming typically requires two parameters. The first parameter is the message or question to be displayed to the user, and the second parameter is the default value or input that the prompt will show. These two parameters allow the prompt() method to interact with the user and retrieve input from them.

    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 returns the month as an integer. This means that it will return a numerical value representing the month, such as 1 for January, 2 for February, and so on. This is the most common and standard way of representing the month in programming, as it allows for easy comparison and manipulation of dates and times.

    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 that button is invoked. In this case, the correct answer is "Onclick()" because it is the event that occurs when the button is clicked. The other options mentioned, such as OnSubmit(), OnLoad(), and IsPostBack(), are not specifically related 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
    In object-oriented programming, a function associated with an object is called a method. Methods are defined within a class and can be called on instances of that class. They are used to perform specific actions or operations on the object's data. Unlike functions, methods have access to the object's attributes and can modify them if needed. Therefore, "method" is the correct answer as it accurately describes the relationship between an object and its associated function.

    Rate this question:

  • 11. 

    Inside which HTML element do we put the JavaScript?

    • A.

      Js

    • B.

      JavaScript

    • C.

      Script

    • D.

      Scripting

    Correct Answer
    B. JavaScript
    Explanation
    The correct answer is "script". This is because the element is used to embed or reference an external JavaScript file within an HTML document. It can also be used to write JavaScript code directly within 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
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 02, 2019
    Quiz Created by
    BayanRadaideh
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.