Java Script

JavaScript is a Scripting Language

A scripting language is a lightweight programming language.
JavaScript is programming code that can be inserted into HTML pages.
JavaScript inserted into HTML pages, can be executed by all modern web browsers.
JavaScript is easy to learn.
There are 20 question in each sets with answers:
MCQ FOR JAVA SCRIPT

Q1.    <script type="text/javascript">
             x=4+"4";
            document.write(x);
           </script>
         Output------?
a) 44
b) 8
c) 4
d) Error output

Q2. <script type="text/javascript" language="javascript">
var qpt = "Qualiyt Point Technologies";
var result = qpt.split(" ");
document.write(result);
</script>
a) Quality
b) Q,u,a,l,i,t,y,P,o,i,n,t,T,e,c,h,n,o,l,o,g,i,e,s
c) Qualiyt,Point,Technologies
d) QualityPointTechnologies


Q3. Is it possible to nest functions in JavaScript?
a) True
b) False
Q4.  <script>
document.write(navigator.appCodeName);
</script>
a) get code name of the browser of a visitor
b) set code name of the browser of a visitor
c) None of the above

Q5. Which of the following is true?
a) If onKeyDown returns false, the key-press event is cancelled.
b) If onKeyPress returns false, the key-down event is cancelled.
c) If onKeyDown returns false, the key-up event is cancelled.
d) If onKeyPress returns false, the key-up event is canceled.

Q6. Scripting language are
a) High Level Programming language
b) Assembly Level programming language
c) Machine level programming language

Q7. Which best explains getSelection()?
a) Returns the VALUE of a selected OPTION.
b) Returns document.URL of the window in focus.
c) Returns the value of cursor-selected text
d) Returns the VALUE of a checked radio input.

Q8. <script language="javascript">
function x()
{
var s= "Good 100%";
var pattern = /\D/g;
var output= s.match(pattern);
document.write(output);
}
</script>
a) Good %
b) 1,0,0
c) G,o,o,d,%
d) Error

Q9. <script language="javascript">
var qpt="QUALITY POINT TECHNOLOGIES";
alert(qpt.charAt(qpt.length-1));
</script>
a) P
b) E
c) S
d) Error


Q10. Choose the client-side JavaScript object:
a) Database
b) Cursor
c) Client
d) FileUpLoad


Q11. Are java and javascript the same?
a) NO
b) YES


Q12. Syntax for creating a RegExp object:
(a). var txt=new RegExp(pattern,attributes);
(b). var txt=/pattern/attributes;
Which of the above mentioned syntax will correct?
a) (a) only
b) (b) only
c) Both (a) and (b)
d) None of the above


Q13. <script language="javascript">
function x(z,t)
{
alert(x.length);
}
</script>
output:
?
a) Error
b) 2
c) 1
d) 3

Q14. What is mean by "this" keyword in javascript?
a) It refers current object
b) It referes previous object
c) It is variable which contains value
d) None of the above

Q15. In JavaScript, Window.prompt() method return true or false value ?
a) False
b) True
c) None of above

Q16. Math. round(-20.51)=?
a) 20
b) -21
c) 19
d) None

Q17. <script language="javascript">
function x()
{
var s = "Quality 100%!{[!!";
var pattern = /\w/g;
var output = s.match(pattern);
document.write(output);
}
</script>
a) %,!,{,[,!,!
b) Q,u,a,l,i,t,y,1,0,0
c) Quality 100
d) Error

Q18. <script type="text/javascript" language="javascript">
var qpt= new Array();
qpt[0] = "WebDevelopment";
qpt[1]="ApplicationDevelopment"
qpt[2]="Testing"
qpt[3] = "QualityPointTechnologies";
document.write(qpt[0,1,2,3]);
</script>
a) Error
b) QualityPointTechnologies
c) WebDevelopment
d) WebDevelopmnet,ApplicationDevelopment,Testing,QualityPointTechnologies

Q.19 Choose the server-side JavaScript object:
a) FileUpLoad
b) Function
c) File
d) Date

Q.20) parseFloat(9+10)=?
a) 19
b) 910
c) None

(1) a
(2) c
(3) a
(4) a
(5) a
(6) a
(7) c
(8) c
(9) c
(10) d
(11) a
(12) c
(13) b
(14) a
(15) a
(16) b
(17) b
(18) b
(19) c
(20) c

Q21. <script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script>
a) 258
b) Error
c) 7
d) 78


Q22._________ keyword is used to declare variables in javascript.
a) Var
b) Dim
c) String


Q23. In Javascript, Which of the following method is used to evaluate the regular expression?
a) eval(2*(3+5))
b) evaluate(2*(3+5))
c) evalu(2*(3+5))
d) None of the above


Q24. <script language="javascript">
function x()
{
var s= "quality 100%";
var pattern = /\d/g;
var output= s.match(pattern);
document.write(output);
}
</script>
a) 100
b) 1,0,0
c) q,u,a,l,i,t,y,%
d) Error


Q 25. <script type="text/javascript" language="javascript">
qpt=((45%2)==0)? "hello" : "bye";
document.write(qpt);
</script>
a) hello
b) bye
c) Error in string handling
d) None of the above


Q. 26 .<script language="javascript">
function x()
{
var qpt = "QualityPointTechnologies";
var pattern = new RegExp("POIiNT","i");
document.write(qpt.match(pattern));
}
</script>
a) Error
b) POIiNT
c) Point
d) null


Q.27. How do you create a new object in JavaScript?
a) var obj = {};
b) var obj = Object();
c) var obj=new {};
d) None of the above


Q.28. In Javascript, What does isNaN function do ?
a) Return true if the argument is not a number.
b) Return false if the argument is not a number.
c) Return true if the argument is a number.
d) None of the above


Q.29. If x=103 & y=9 then x%=y , what is the value of x after executing x%=y?
a) 4
b) 3
c) 2
d) 5


Q.30. Choose the external object:
a) Date
b) Option
c) Layer
d) Checkbox


Q.31. Choose the four symbol pairs that represent RegExp properties lastMatch, lastParent, leftContext, and rightContext, respectively:
a) $&, $+, $`, $'
b) $+, $&, $', $`
c) $&, $~, $`, $'
d) $+, $&, $`, $'


Q.32. Which of the following properties hold the values of the pixels of the length of the width and height of the viewer's screen resolution?
a) screen.width and screen.height
b) Resolution.width and Resolution.height
c) screen.pixels.width and screen.pixels.height
d) ViewerScreen.width and ViewerScreen.height


Q.33. ParseInt(“15”,10)=?
a) 15
b) 10
c) 151
d) 150


Q.34. Which JavaScript feature uses JAR files?
a) Object signing
b) Style sheets
c) Netcaster channels
d) Image rollovers


Q.3.How to assign a function to a variable with the JavaScript Function contructor ?
a) var f=Function("x","y","return x+y");
b) var f=Function(x,y){ return x+y;}
c) var f= new Function("x", "y", "return x + y");


Q.36. In JavaScript, Window.alert() is used to allow user to enter something
a) True
b) False
c) None of above


Q.37. <script language="javascript">
function x()
{
var qpt = "We are fast growing Software Company located in Chennai, India.";
var pattern = new RegExp("in","gi");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
document.write(pattern.exec(qpt) + " ");
}
</script>
a) in in In
b) in in in
c) in in null
d) in null null


Q.38. Is Javascript has any date data type?
a) Yes
b) No


Q.39. Math. round(-20.5)=?
a) -21
b) 20
c) -20
d) 21


Q.40 ?_name is it valid javascript identifier?
a) Yes
b) No

ANSWERS
(21) d
(22) a
(23) a
(24) b
(25) b
(26) d
(27) a
(28) a
(29) a
(30) d
(31) a
(32) a
(33) a
(34) a
(35) c
(36) b
(37) a
(38) b
(39) c
(40) b





















































































































































2 comments:

  1. Very helpful information..thanks for sharing it guys...
    SEO Company in India

    ReplyDelete
  2. The post is very nicely written and it contains many useful facts. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement. Thanks for sharing with us.
    Website development company in bangalore
    Website Design and Development Company in Bangalore
    ECommerce Web Design Company in bangalore
    Outsource magento ecommerce services india

    ReplyDelete