Web tech 512 MCQs - I wanted to share this document because it\'s useful for web tec PDF

Title Web tech 512 MCQs - I wanted to share this document because it\'s useful for web tec
Author Edwin Klost
Course Web tech
Institution Richfield Graduate Institute of Technology
Pages 10
File Size 194.1 KB
File Type PDF
Total Downloads 63
Total Views 140

Summary

I wanted to share this document because it's useful for web tech...


Description

Web tech 512 MCQ Consider the following code snippet: Var a = [1,2,3,4,5]; a.slice(0,3); what is the possible output for the above code snippet? Select one: Returns [1,2,3] Consider the following code snippet: Var tensquared = (function(x) {returns x*x;})10)); Will the above code work? Select one: Yes, perfectly Consider the following code snippet Function hypotenuse(a,b) { Function square(x) Return x*x; } Return Math.sqrt(squire(a) + square(b)); } What does the above code results? Select one: Sum of squire of a and b The pop() method of the array does which of the following task? Select one: decrements the total length by 1 The method or operator used to identify the array is Select one: typeof When does the function name become optional in JavaScript? Select one: When the function is defined as expressions Don function in JavaScript necessarily return a value? Select one: Few functions return values by default Consider the following code snippet:

If(!a[i]); continue What is the observation made? Select one: All of the option mentioned 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: Select one: 1 What is the difference between the two lines given below? !!(obj1&& obj2); (obj1 && obj2); Select one: The first line results in a real Boolean value whereas the second line merely checks for the existence of the objects Consider the following code snippet: Function constfuncs() { Var funcs = []; For (var i = 0; i < 10; i++)}; Return funcs; } Var funcs = constfuncs(); Funcs[5]() What does the last statement return? Select one: 10 For the below mentioned code snippet: Var = 0 = new Object();

The equivalent statement is: Select one: var o= new Object; The one-liner code that concatenates all strings passed into a function is Select one: function concatenate() { Return string.prototype.concat.apply{“,arguments); } If you have a function f and an object o, you can define a method named m of o with Select one: o.m=m.f; Consider the following code snippet : Var a = []; a.unshift(1); a.unshift(22); a.shift(); a.unshift(3,[4,5]; a.shift(); a.shift(); a.shift(); advertisements The final output for the shift() Is Select one: 1 If para1 is the DOM object for the paragraph, what is the correct syntax to change the text within the paragraph? Select one: para1.nodeValue=”New Text”: Class provides an interface for invoking JavaScript methods and examining JavaScript properties. Select one: JSObject Which best explains getSelection()?

Select one: Returns the value of cursor-selected text What are variables used for in HavaScript Programs? Select one: Storing numbers, dates, or other values To open a dialog box each time an error occurs,which of the following is added to prefs.js? Select one: user_pref(“javascript.classic.error_alerts”, true); Choose the client-side JavaScript object? Select one: FileUpLoad Scripting language are Select one: High Level Programming language The syntax of capture events method for document object is Select one: captureEvents(eventType) Which of the following is the structure of an if statements? Select one: If(conditional expression is true) {then execute this code>->} When a javaScript object is sent to Java, the runtime engine creates a java wrapper of type Select one: JSObject Which of the following is not valid JavaScript variable name? Select one: 2names Tag is an extension to HTML that can enclose any number of JavaScrip statements. Select one: Choose the server-side JavaScript object? Select one: File In JavaScript is an object of the target language data type that encloses an object of the source language Select one: a wrapper Which of the following can’t be done with client-side JavaScript? Select one: Storing the form’s contents to a database file on the server JavaScript is also called client-side JavaScript Select one: Navigator To automatically open the console when JavaScript error occurs which of the following is added to prefs.js? Select one: user_pref(“javascript.console.open_on_error”, true); What is the correct JavaScript syntax to write “Hello World”? Select one: document.write(“Hello World”) Which of the following is not considered a JavaScript operator? Select one: this Inside which HTML element do we put the JavaScript? Select one: Select one: 78 Which is the correct way to write a JavaScript array? Select one: var txt = new Array(“tim”,”kim”,”jim”) Method evaluates a string of JavaScript code in the context of the specified object. Select one: Eval The keydown event occurs when a viewer presses down a key on the keyboard. Select one: True Which of the following function of Array object adds one or more elements to the end of an array and returns the new length of the array? Select one: push() To set up the window to capture all click events, we use which of the following statement? Select one: window.captureEvents(Event.CLICK); Which of the following function of string object extracts a section of a string and returns a new string? Select one: slice() Which of the following event fires when the form element loses the focus: , ,,,? Select one: onblur Which of the following function of Number object returns the number’s value? Select one: valueOf() The array Select one: Splice

method of an Array object adds and/or removes elements from an

Which built-in method returns the length of the string? Select one: length() Can you pass a anonymous function as an argument to another function? Select one: true Which tags(s) can handle mouse events in Netscape? Select one: To enable data tainting, the end user sets the

environment variable.

Select one: NS_ENABLE_TAINT Is the tainted property of a window object Select one: Defaultstatus To set up the window to capture all click events, we use which of the following statements? Select one: window.captureEvents(Event.CLICK); Which of the following is a valid type of function javaScript supports? Select one: All of the option mentioned. Which built-in method returns the calling string value converted to lower case Select one: toLowerCase() Which of the following function of Array object sorts the elements of an array? Select one: sort() Which built-in method combines the text of two strings and returns a new string? Select one: concat() The syntax of close method for document object is

Select one: Close() The mousedown event uses what keyword as its event handler? Select one: mousedown What is the output of the below code?

Var s = “9123456 or 80000?”; Var pattern = /\d{4}/;

Var output = s.match(pattern); Document.write(output);

Select one: 9123 Which of the following function of string object returns the index within the calling String object of the last occurrence of the specified value? Select one: lastIndexOf() Which of the following is correct about JavaScript? Select one: All of the option mentioned. Which of the following function of Array object applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value? Select one: reduce() What is the purpose of the basic validation? Select one: Mere data existence What would happen if the data in the client had been wrong? Select one: Sends back the data and waits for correction What is the purpose of the mimeTypes property of a plug-in entry Select one: Contains MIME types Which of the following is the child object of the JavaScript navigator? Select one: Plugins What is it called when we make a mistake in the script? Select one: Bug Which of the following is the definition for debugging? Select one: Finding bugs and Fixing bugs Which of the following are the properties of a plug-in entry? Select one: All of the option mentioned How do we debug a script? Select one: Use of JavaScript Validato and Use of JavaScript Debugger Where is the error icon shown in the internet Explore? Select one: Status bar

What kind of error notifications are shown in the console window? Select one: Syntax error and Runtime error...


Similar Free PDFs