Interview Questions For JavaScript

331 Questions | Total Attempts: 120

SettingsSettingsSettings
Please wait...
JavaScript Quizzes & Trivia

Questions and Answers
  • 1. 
    Java Script File Has An Extension Of
    • A. 

      .Java

    • B. 

      .Js

    • C. 

      .javascript

    • D. 

      .xml

  • 2. 
    The Tag is used To Give Heading To The Table
    • A. 

      Head

    • B. 

      Td

    • C. 

      Th

    • D. 

      Caption

  • 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

  • 4. 
    Function is Used To Parse a String To Int
    • A. 

      Integer.Parse

    • B. 

      Int.Parse

    • C. 

      Parse.Int

    • D. 

      None

  • 5. 
    Which Of The Dialog Box Display a Message And a Data Entry Field
    • A. 

      Alert()

    • B. 

      Prompt()

    • C. 

      Confirm()

    • D. 

      Msg()

  • 6. 
    Event is Used To Check An Empty Text Box
    • A. 

      Onclick()

    • B. 

      OnFocus()

    • C. 

      OnBlur()

    • D. 

      None

  • 7. 
    Method Prompt() Contain ........Number of Parameters
    • A. 

      One

    • B. 

      Two

    • C. 

      Three

    • D. 

      Zero

  • 8. 
    GetMonth() returns The Month as
    • A. 

      Int

    • B. 

      Float

    • C. 

      Char

    • D. 

      String

  • 9. 
    If Button is clicked .......Event Handler is invoked
    • A. 

      OnSubmit()

    • B. 

      OnLoad()

    • C. 

      IsPostBack()

    • D. 

      Onclick()

  • 10. 
    A Function Associated With An object is Called
    • A. 

      Function

    • B. 

      Method

    • C. 

      Link

    • D. 

      None

  • 11. 
    Inside which HTML element do we put the JavaScript?
    • A. 

      Js

    • B. 

      JavaScript

    • C. 

      Script

    • D. 

      Scripting

  • 12. 
    Which property would you use to redirect visitor to another page?
    • A. 

      Window.location.href

    • B. 

      Document.href

    • C. 

      Java.redirect.url

    • D. 

      Link.redirect.href

  • 13. 
    Wich best describe void?
    • A. 

      A method

    • B. 

      A function

    • C. 

      An operator

    • D. 

      A statement

  • 14. 
    What is the correct JavaScript syntax to write "Hello World"?
    • A. 

      Response.write("Hello World")

    • B. 

      Document.write("Hello World")

    • C. 

      ("Hello World")

    • D. 

      Echo("Hello World")

  • 15. 
    How do you call a function named "myFunction"?
    • A. 

      Call myFunction()

    • B. 

      MyFunction()

    • C. 

      Call function myFunction

  • 16. 
    How do you write a conditional statement for executing some statements only if "i" is equal to 5?
    • A. 

      If i==5 then

    • B. 

      If i=5 then

    • C. 

      If (i==5)

    • D. 

      If i=5

  • 17. 
    How many different kind of loops are there in JavaScript?
    • A. 

      Two. The "for" loop and the "while" loop

    • B. 

      Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop

    • C. 

      One. The "for" loop

  • 18. 
    How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?
    • A. 

      If (i 5)

    • B. 

      If (i != 5)

    • C. 

      If =! 5 then

    • D. 

      If 5

  • 19. 
    How does a "for" loop start?
    • A. 

      For (i = 0; i

    • B. 

      For (i = 0; i

    • C. 

      For i = 1 to 5

    • D. 

      For (i

  • 20. 
    What is the correct way to write a JavaScript array?
    • A. 

      Var txt = new Array("tim","shaq","kobe")

    • B. 

      Var txt = new Array="tim","shaq","kobe"

    • C. 

      Var txt = new Array(1:"tim",2:"shaq",3:"kobe")

  • 21. 
    Onclick is equivalent to which two events in sequence
    • A. 

      Onmouseover and onmousedown

    • B. 

      Onmousedown and onmouseout

    • C. 

      Onmousedown and onmouseup

    • D. 

      Onmouseup and onmouseout

  • 22. 
    You define an array using
    • A. 

      Var myarray = new Array();

    • B. 

      Var myarray = array new;

    • C. 

      Var new Array() = myarray;

    • D. 

      Var new array = myarray;

  • 23. 
    How do you round the number 8.25, to the nearest whole number?
    • A. 

      Math.rnd(8.25)

    • B. 

      Math.round(8.25)

    • C. 

      Round(8.25)

    • D. 

      Rnd(8.25)

  • 24. 
    CHow do you find the largest number of 6 and 8?
    • A. 

      Math.max(6,8)

    • B. 

      Top(6,8)

    • C. 

      Ceil(6,8)

    • D. 

      Math.ceil(6,8)

  • 25. 
    How do you find the client's browser name?
    • A. 

      Navigator.appName

    • B. 

      Client.navName

    • C. 

      Browser.name