Interview Questions For JavaScript

331 Questions | Attempts: 179
Share

SettingsSettingsSettings
Computer Programming Quizzes & Trivia

Questions and Answers
  • 1. 

    Java Script File Has An Extension Of

    • A.

      .Java

    • B.

      .Js

    • C.

      .javascript

    • D.

      .xml

    Correct Answer
    B. .Js
  • 2. 

    The Tag is used To Give Heading To The Table

    • A.

      Head

    • B.

      Td

    • C.

      Th

    • D.

      Caption

    Correct Answer
    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

    Correct Answer
    B. Is Not a Number
  • 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
  • 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()
  • 6. 

    Event is Used To Check An Empty Text Box

    • A.

      Onclick()

    • B.

      OnFocus()

    • C.

      OnBlur()

    • D.

      None

    Correct Answer
    C. OnBlur()
  • 7. 

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

    • A.

      One

    • B.

      Two

    • C.

      Three

    • D.

      Zero

    Correct Answer
    B. Two
  • 8. 

    GetMonth() returns The Month as

    • A.

      Int

    • B.

      Float

    • C.

      Char

    • D.

      String

    Correct Answer
    A. Int
  • 9. 

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

    • A.

      OnSubmit()

    • B.

      OnLoad()

    • C.

      IsPostBack()

    • D.

      Onclick()

    Correct Answer
    D. Onclick()
  • 10. 

    A Function Associated With An object is Called

    • A.

      Function

    • B.

      Method

    • C.

      Link

    • D.

      None

    Correct Answer
    B. Method
  • 11. 

    Inside which HTML element do we put the JavaScript?

    • A.

      Js

    • B.

      JavaScript

    • C.

      Script

    • D.

      Scripting

    Correct Answer
    B. JavaScript
  • 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

    Correct Answer
    A. Window.location.href
  • 13. 

    Wich best describe void?

    • A.

      A method

    • B.

      A function

    • C.

      An operator

    • D.

      A statement

    Correct Answer
    C. An operator
  • 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")

    Correct Answer
    B. Document.write("Hello World")
  • 15. 

    How do you call a function named "myFunction"?

    • A.

      Call myFunction()

    • B.

      MyFunction()

    • C.

      Call function myFunction

    Correct Answer
    B. 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

    Correct Answer
    C. 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

    Correct Answer
    A. Two. The "for" loop and the "while" 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

    Correct Answer
    B. If (i != 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

    Correct Answer
    B. For (i = 0; 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")

    Correct Answer
    A. Var txt = new Array("tim","shaq","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

    Correct Answer
    C. Onmousedown and onmouseup
  • 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;

    Correct Answer
    A. Var myarray = new Array();
  • 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)

    Correct Answer
    B. Math.round(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)

    Correct Answer
    A. Math.max(6,8)
  • 25. 

    How do you find the client's browser name?

    • A.

      Navigator.appName

    • B.

      Client.navName

    • C.

      Browser.name

    Correct Answer
    A. Navigator.appName
  • 26. 

    What is the correct JavaScript syntax for opening a new window called "window5" ?

    • A.

      New("http://www.ex-designz.net","window5")

    • B.

      Window.open("http://www.ex-designz.net","window5")

    • C.

      Open.newwindow("http://www.ex-designz.net","window5")

    • D.

      New.window("http://www.ex-designz.net","window5")

    Correct Answer
    B. Window.open("http://www.ex-designz.net","window5")
  • 27. 

    How do you put a message in the browser's status bar?

    • A.

      Window.status = "put your message here"

    • B.

      Statusbar = "put your message here"

    • C.

      Status("put your message here")

    • D.

      Window.status("put your message here")

    Correct Answer
    A. Window.status = "put your message here"
  • 28. 

    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

    Correct Answer
    A. Window.location.href
  • 29. 

    Wich best describe void?

    • A.

      A method

    • B.

      A function

    • C.

      An operator

    • D.

      A statement

    Correct Answer
    C. An operator
  • 30. 

    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")

    Correct Answer
    B. Document.write("Hello World")
  • 31. 

    How do you call a function named "myFunction"?

    • A.

      Call myFunction()

    • B.

      MyFunction()

    • C.

      Call function myFunction

    Correct Answer
    B. MyFunction()
  • 32. 

    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

    Correct Answer
    C. If (i==5)
  • 33. 

    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

    Correct Answer
    A. Two. The "for" loop and the "while" loop
  • 34. 

    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

    Correct Answer
    B. If (i != 5)
  • 35. 

    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

    Correct Answer
    B. For (i = 0; i
  • 36. 

    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")

    Correct Answer
    A. Var txt = new Array("tim","shaq","kobe")
  • 37. 

    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

    Correct Answer
    C. Onmousedown and onmouseup
  • 38. 

    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;

    Correct Answer
    A. Var myarray = new Array();
  • 39. 

    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)

    Correct Answer
    B. Math.round(8.25)
  • 40. 

    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)

    Correct Answer
    A. Math.max(6,8)
  • 41. 

    How do you find the client's browser name?

    • A.

      Navigator.appName

    • B.

      Client.navName

    • C.

      Browser.name

    Correct Answer
    A. Navigator.appName
  • 42. 

    What is the correct JavaScript syntax for opening a new window called "window5" ?

    • A.

      New("http://www.ex-designz.net","window5")

    • B.

      Window.open("http://www.ex-designz.net","window5")

    • C.

      Open.newwindow("http://www.ex-designz.net","window5")

    • D.

      New.window("http://www.ex-designz.net","window5")

    Correct Answer
    B. Window.open("http://www.ex-designz.net","window5")
  • 43. 

    How do you put a message in the browser's status bar?

    • A.

      Window.status = "put your message here"

    • B.

      Statusbar = "put your message here"

    • C.

      Status("put your message here")

    • D.

      Window.status("put your message here")

    Correct Answer
    A. Window.status = "put your message here"
  • 44. 

    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

    Correct Answer
    A. Window.location.href
  • 45. 

    Wich best describe void?

    • A.

      A method

    • B.

      A function

    • C.

      An operator

    • D.

      A statement

    Correct Answer
    C. An operator
  • 46. 

    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")

    Correct Answer
    B. Document.write("Hello World")
  • 47. 

    How do you call a function named "myFunction"?

    • A.

      Call myFunction()

    • B.

      MyFunction()

    • C.

      Call function myFunction

    Correct Answer
    B. MyFunction()
  • 48. 

    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

    Correct Answer
    C. If (i==5)
  • 49. 

    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

    Correct Answer
    A. Two. The "for" loop and the "while" loop
  • 50. 

    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

    Correct Answer
    B. If (i != 5)

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, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 27, 2017
    Quiz Created by
    Er.lokesh
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.