Javascript MCQ Set 1
1. What is it called when we make a mistake in the script?
a) Error
b) Bug
c) Mistake
d) All of the mentioned
Answer
Answer: b [Reason:] A mistake in a script is referred to as a bug.
2. Which of the following is the definition for debugging?
a) Finding bugs
b) Fixing bugs
c) Both Finding & Fixing bugs
d) None of the mentioned
Answer
Answer: c [Reason:] The process of finding and fixing bugs is called debugging and is a normal part of the development process.
3. Where is the error icon shown in the Internet Explorer?
a) Taskbar
b) Status bar
c) Both Taskbar and Status bar
d) None of the mentioned
Answer
Answer: b [Reason:] The error icon is shown in the status bar of the Internet Explorer.
4. Where is the error icon option available?
a) Tools
b) Help
c) File
d) Edit
Answer
Answer: a [Reason:] The error icon option can be enabled in the Tools.
5. Which of the following is the window that the Firefox sends the error messages to?
a) Bug Window
b) Error Issues
c) Error Window
d) Error Console
Answer
Answer: d [Reason:] The browsers like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript Console or Error Consol.
6. What is the procedure to view the console in the Firefox?
a) Tools->Error Console
b) Tools->Error Window
c) Help->Error Console
d) None of the mentioned
Answer
Answer: a [Reason:] To view the console, select Tools –> Error Consol or Web Development.
7. What is the other way of calling the Error Console in Firefox?
a) Error Window
b) JavaScript Console
c) JavaScript Window
d) All of the mentioned
Answer
Answer: b [Reason:] The Error Console is also termed as the JavaScript Console.
8. What kind of error notifications are shown in the console window?
a) Syntax error
b) Runtime error
c) Both Syntax error and Runtime error
d) None of the mentioned
Answer
Answer: c [Reason:] Error notifications that show up on Console or through Internet Explorer dialog boxes are the result of both syntax and runtime errors. These error notification include the line number at which the error occurred.
9. How do we debug a script?
a) Use of JavaScript Validator
b) Use of JavaScript Debugger
c) Use of JavaScript Validator & Debugger
d) None of the mentioned
Answer
Answer: c [Reason:] Both the JavaScript Validator and the JavaScript Debugger can be used to debug a script.
10. What is the purpose of a JavaScript debugger?
a) Correction of errors
b) Placing script execution under control
c) Correction of errors & Placing script execution under control
d) None of the mentioned
Answer
Answer: b [Reason:] A debugger is an application that places all aspects of script execution under the control of the programmer. Debuggers provide fine-grained control over the state of the script through an interface that allows you to examine and set values as well as control the flow of execution.
Javascript MCQ Set 2
1. Consider the following code snippet :
var grand_Total=eval("10*10+5");
The output for the above statement would be :
a) 10*10+5
b) 105 as a string
c) 105 as an integer value
d) Exception is thrown
Answer
Answer: c [Reason:] Even if the string value passed as a parameter to eval does represent a numeric value the use of eval() results in an error being generated.
2. Do functions in JavaScript necessarily return a value ?
a) It is mandatory
b) Not necessary
c) Few functions return values by default
d) All of the mentioned
Answer
Answer: c [Reason:] None.
3. Consider the following code snippet :
var tensquared = (function(x) {return x*x;}(10));
Will the above code work ?
a) Yes, perfectly
b) Error
c) Exception will be thrown
d) Memory leak
Answer
Answer: a [Reason:] Function name is optional for functions defined as expressions. Function expressions are sometimes defined and immediately invoked.
4. Consider the following code snippet :
var string2Num=parseInt("123xyz");
The result for the above code snippet would be :
a) 123
b) 123xyz
c) Exception
d) NaN
Answer
Answer: b [Reason:] The parseInt() function returns the first integer contained in the string or 0 if the string does not begin with an integer.
5. The one-liner code that concatenates all strings passed into a function is
a) function concatenate() { return String.prototype.concat('', arguments); } b) function concatenate() { return String.prototype.apply('', arguments); } c) function concatenate() { return String.concat.apply('', arguments); } d) function concatenate() { return String.prototype.concat.apply('', arguments); }
Answer
Answer: d [Reason:] None
6. If you have a function f and an object o, you can define a method named m of o with
a) o.m=m.f;
b) o.m=f;
c) o=f.m;
d) o=f;
Answer
Answer: a [Reason:] A method is nothing more than a JavaScript function that is stored in a property of an object. If you have a function f and an object o, you can define a method named m of o with the following line:
o.m = f;
7. For the below mentioned code snippet:
var o = new Object();
The equivalent statement is:
a) var o = Object(); b) var o; c) var o= new Object; d) Object o=new Object();
Answer
Answer: c [Reason:] You can always omit a pair of empty parentheses in a constructor invocation.
8. What is the difference between the two lines given below ?
!!(obj1 && obj2); (obj1 && obj2);
a) Both the lines result in a boolean value “True”
b) Both the lines result in a boolean value “False”
c) Both the lines checks just for the existence of the object alone
d) The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
Answer
Answer: d [Reason:] None.
9. Consider the following code snippet :
var c = counter(), d = counter(); c.count() d.count() c.reset() c.count() d.count()
The state stored in d is :
a) 1
b) 0
c) Null
d) Undefined
Answer
Answer: a [Reason:] The state stored in d is 1 because d was not reset.
10. Consider the following code snippet :
function constfuncs() { var funcs = []; for(var i = 0; i < 10; i++) funcs[i] = function() { return i; }; return funcs; } var funcs = constfuncs(); funcs[5]()
What does the last statement return ?
a) 9
b) 0
c) 10
d) None of the mentioned
Answer
Answer: c [Reason:] The code above creates 10 closures, and stores them in an array. The closures are all defined within the same invocation of the function, so they share access to the variable i. When constfuncs() returns, the value of the variable i is 10, and all 10 closures share this value. Therefore, all the functions in the returned array of functions return the same value.
Javascript MCQ Set 3
1. R is an extension of which of the following language?
a) C
b) C++
c) S
d) None of the mentioned
Answer
Answer: c [Reason:] R is an extension of and successor to the S language, which was itself a statistical language created in 1976 by John Chambers while at Bell Labs.
2. Which of the following is/are statistical languages?
a) R
b) S
c) None of the mentioned
d) Both R and S
Answer
Answer: d [Reason:] Both R and S are statistical languages.
3. Which of the following is a successor to the S language?
a) C++
b) R
c) S
d) Java
Answer
Answer: b [Reason:] R is an extension of and successor to the S language, which was itself a statistical language.
4. What are the purposes R can be used for?
a) Suck in data
b) Parse data
c) Process data
d) All of the mentioned
Answer
Answer: d [Reason:] Generally, R can be used to suck in data, parse it, process it, and then visualize it for reporting purposes.
5. What type of language is generally used to collect the data?
a) Glue language
b) Statistical language
c) Both Glue and Statistical language
d) None of the mentioned
Answer
Answer: a [Reason:] A glue language is generally used to collect the data, that is written out as a comma-separated file, and read it into R.
6. What are the processes that take place within R?
a) Splitting of data
b) Aggregating of data
c) Overlaying two or more data
d) All of the mentioned
Answer
Answer: d [Reason:] Within R, processing the data, splitting it, averaging it, aggregating it, overlaying two or more data sets, and then from with R, a chart that depicts the data out is done.
7. Which platform is R imported to after charting as a PDF?
a) Adobe Illustrator
b) Adobe Photoshop
c) Both Adobe Illustrator and Adobe Photoshop
d) None of the mentioned
Answer
Answer: a [Reason:] From R, the chart is imported into the Adobe Illustrator, or any other such program, where it can clean up things like font consistency and make sure axis labels with long names are visible.
8. What is the purpose of a glue language?
a) Format data
b) Producte data
c) Collectc data
d) Both Format and Collectc
Answer
Answer: d [Reason:] A glue language is generally used to collect and format the data.
9. Why do we use Adobe Illustrator along with R?
a) Collect the relevant data
b) Format the chart and to correct the errors
c) Tighten and format the chart
d) Ingest and process the chart
Answer
Answer: c [Reason:] The Adobe Illustrator is used along with R to tighten and format the chart.
10. What does the R language do?
a) Tighten and format the chart
b) Ingest and process the chart
c) Format and Ingest the chart
d) None of the mentioned
Answer
Answer: b [Reason:] The R language is generally used to collect data that has been collected by the glue language and then ingest and process and chart.
Javascript MCQ Set 4
1. R is an extension of which of the following language?
a) C
b) C++
c) S
d) None of the mentioned
Answer
Answer: c [Reason:] R is an extension of and successor to the S language, which was itself a statistical language created in 1976 by John Chambers while at Bell Labs.
2. Which of the following is/are statistical languages?
a) R
b) S
c) None of the mentioned
d) Both R and S
Answer
Answer: d [Reason:] Both R and S are statistical languages.
3. Which of the following is a successor to the S language?
a) C++
b) R
c) S
d) Java
Answer
Answer: b [Reason:] R is an extension of and successor to the S language, which was itself a statistical language.
4. What are the purposes R can be used for?
a) Suck in data
b) Parse data
c) Process data
d) All of the mentioned
Answer
Answer: d [Reason:] Generally, R can be used to suck in data, parse it, process it, and then visualize it for reporting purposes.
5. What type of language is generally used to collect the data?
a) Glue language
b) Statistical language
c) Both Glue and Statistical language
d) None of the mentioned
Answer
Answer: a [Reason:] A glue language is generally used to collect the data, that is written out as a comma-separated file, and read it into R.
6. What are the processes that take place within R?
a) Splitting of data
b) Aggregating of data
c) Overlaying two or more data
d) All of the mentioned
Answer
Answer: d [Reason:] Within R, processing the data, splitting it, averaging it, aggregating it, overlaying two or more data sets, and then from with R, a chart that depicts the data out is done.
7. Which platform is R imported to after charting as a PDF?
a) Adobe Illustrator
b) Adobe Photoshop
c) Both Adobe Illustrator and Adobe Photoshop
d) None of the mentioned
Answer
Answer: a [Reason:] From R, the chart is imported into the Adobe Illustrator, or any other such program, where it can clean up things like font consistency and make sure axis labels with long names are visible.
8. What is the purpose of a glue language?
a) Format data
b) Producte data
c) Collectc data
d) Both Format and Collectc
Answer
Answer: d [Reason:] A glue language is generally used to collect and format the data.
9. Why do we use Adobe Illustrator along with R?
a) Collect the relevant data
b) Format the chart and to correct the errors
c) Tighten and format the chart
d) Ingest and process the chart
Answer
Answer: c [Reason:] The Adobe Illustrator is used along with R to tighten and format the chart.
10. What does the R language do?
a) Tighten and format the chart
b) Ingest and process the chart
c) Format and Ingest the chart
d) None of the mentioned
Answer
Answer: b [Reason:] The R language is generally used to collect data that has been collected by the glue language and then ingest and process and chart.
Javascript MCQ Set 5
1. What is the purpose of the canvas element?
a) Creates drawing surface
b) Exposes powerful drawing API to client-side JavaScript
c) Creates drawing surface & Exposes powerful drawing API to client-side JavaScript
d) None of the mentioned
Answer
Answer: c [Reason:] The canvas element has no appearance of its own but creates a drawing surface within the document and exposes a powerful drawing API to client-side JavaScript.
2. From which version of IE is canvas supported?
a) 7
b) 8
c) 9
d) Not yet supported
Answer
Answer: c [Reason:] The canvas element is not supported by IE before IE9, but it can be reasonably well emulated in IE6, 7, and 8.
3. Which method is used to obtain the “drawing context” object ?
a) getContext()
b) getObject()
c) get()
d) getDrawing()
Answer
Answer: a [Reason:] Most of the Canvas drawing API is defined not on the canvas element itself, but instead on a “drawing context” object obtained with the getContext() method of the canvas.
4. What is the returning value of the getContext() method?
a) Drawing model
b) CanvasRenderingContext2D object
c) Context2D object
d) None of the mentioned
Answer
Answer: b [Reason:] Call getContext() with the argument “2d” to obtain a CanvasRenderingContext2D object that you can use to draw two-dimensional graphics into the canvas. It is important to understand that the canvas element and its context object are two very different objects.
5. How does SVG describe complex shapes?
a) Path of lines
b) Path of curves
c) Path of lines and curves
d) None of the mentioned
Answer
Answer: c [Reason:] SVG describes complex shapes as a “path” of lines and curves that can be drawn or filled.
6. Which is the method invoked to begin a path?
a) begin()
b) path()
c) createPath()
d) beginPath()
Answer
Answer: d [Reason:] The beginPath() is used to begin a new path.
7. Which is the method invoked to connect the last vertex back to the first?
a) closePath()
b) close()
c) connectlast(first)
d) none of the mentioned
Answer
Answer: a [Reason:] The closePath() method connects the last vertex back to the first, thereby creating a path.
8. Which of the following are not the properties of a canvas object?
a) fillStyle
b) strokeStyle
c) lineWidth
d) lineSize
Answer
Answer: d [Reason:] There is no property called lineSize associated with the canvas object.
9. Which of the following is a property used to check how crisp or fuzzy shadows are?
a) shadowColor
b) shadowBlur
c) strokeStyle
d) none of the mentioned
Answer
Answer: b [Reason:] shadowBlur is used to check how crisp or fuzzy shadows are.
10. How do you restore a saved coordinate system?
a) restore()
b) getback()
c) set()
d) none of the mentioned
Answer
Answer: a [Reason:] The saved coordinate system is restored by calling the method restore() associated with the canvas object.
Synopsis and Project Report
You can buy synopsis and project from distpub.com. Just visit https://distpub.com/product-category/projects/ and buy your university/institute project from distpub.com