JavaScript Objective Questions

Thursday, April 10, 2008

  • Code: JavaScript
    /* start code */
    function getNum(x)
    {
    x += 3;
    if(x)
    return x;
    x *= 3;
    return x;
    }

    What will the above decalred function return when called like this getNum(4); ?

    a> 9
    b> 7
    c> 21
    d> 8
  • Which company first implemented the JavaScript language?
    a> Netscape Communications Corp.
    b> Microsoft Corp.
    c> Sun Microsystems Corp.
    d> Consortium of the above companies
  • When was the first release of a browser supporting JavaScript?
    a> 1994
    b> 1995
    c> 1996
    d> 1997
  • The original name of JavaScript was
    a> JavaScript
    b> LiveScript
    c> WireScript
    d> ECMAScript
  • The JavaScript international standard is called
    a> ECMA-262 Standard
    b> DHTML JavaScript Standard
    c> JavaScript 1.3 Standard
    d> ISO-262 Standard
  • Which of the following statements best describes the relationship between JavaScript and DHTML?
    a> JavaScript is DHTML plus CSS plus Document Object Model.
    b> DHTML is Document Object Model plus JavaScript plus CSS.
    c> Document Object Model is JavaScript plus DHTML plus CSS.
    d> JavaScript has nothing to do with DHTML.
  • What label catches all values except those specified in “switch” statement?
    a> otherwise
    b> default
    c> any
    d> all
  • How do you locate the first X in a string txt?

    a> txt.find('X');
    b> txt.locate('X');
    c> txt.indexOf('X');
    d> txt.countTo('X');
  • Which of these contains an executable statement?
    a> // var a = 0; // var b = 0;
    b> /* var a = 0; // var b = 0; */
    c> /* var a = 0; */ var b = 0;
    d> // var a = 0; /* var b = 0; */
  • What does ++ operator do?
    a> Adds two numbers together
    b> Joins two text strings together
    c> Adds 1 to a number
    d> Adds 2 to a number
  • Which of the following does not result in a variable going out of scope?
    a> End of the block in which it was defined
    b> Start of a block in which a like named variable is defined
    c> when a function is called
    d> when the program finishes running
  • Which of these is not a logical operator?
    a> &&
    b> &
    c>
    d> !
  • What does the following statment return, Math.floor(29.36); ?
    a> 30
    b> 29.5
    c> 29
    d> 29.4
  • Code: JavaScript
    /* start code */
    var a = ["s","a","v","e"];
    document.write(a.join(""));

    What would be the output of the above code fragment?
    a> undefined
    b> save
    c> vase
    d> s
  • /* start code */
    var a = 0;
    var b = 1;
    var c = a b;

    What does the variable c contain??
    a> 0
    b> true
    c> false
    d> null
  • What would be the output of the follow statement, document.write("JavaScript ".length); ?
    a> 9
    b> 10
    c> 11
    d> null

0 comments:

Post a Comment

Chitika

About This Blog

Followers

  © Blogger template The Professional Template II by Ourblogtemplates.com 2009

Back to TOP