November 7, 2016 0 Welcome to your JavaScript Name Which of the following can't be done with client-side JavaScript? Sending a form's contents by email None of the above Validating a form Storing the form's contents to a database file on the server What is not true about try-catch block? I. The try statement allows you to define a block of code to be tested for errors while it is being executed II. The catch statement allows you to define a block of code to be executed, if an error occurs in the try block III. try {Block of code to try } catch( Exception err){ message.innerHTML = "Input is " + err; } IV. The finally statement lets you execute code, after try and catch, regardless of the result All are True I and III only Only III Only IV Which of the following best describes JavaScript? a compiled scripting language a low-level programming language. an object-oriented scripting language a scripting language precompiled in the browser How to create a Date object in JavaScript? dateObjectName.new Date([parameters dateObjectName Date([parameters]) dateObjectName := new Date([parameters]) dateObjectName = new Date([parameters]) To change the style of an HTML element correct Syntax is document.getElementByClass(Class).style.Val=new Property document.getElementById(id).Css= New property document.getElementByClass(id).Css.style.property=new style document.getElementById(id).style.property=new style When a user views a page containing a JavaScript program, which machine actually executes the script? None of the above The User's machine running a Web browser A central machine deep within Netscape's corporate offices The Web server Which of the following is not a valid JavaScript variable name? FirstAndLast 2names _first_and_last_names None of the above What is the special feature of the modern web applications? c. d. None of the mentioned Must load the document to manipulate Both a and b Can alter contents without loading document Choose the server-side JavaScript object? File FileUpLoad Date Function What will be output of following code into alert: "use strict"; myFunction(); function myFunction() { y = 3.14; alert("Value of y is " +y); } Value of y is 3.14 y is not declared defined Value of y is undefined None of the above What is not true about String Functions? I. slice(), substring(), substr() are methods for extracting a part of a string II. If a parameter is negative, the position is counted from the end of the string III. If you omit the second parameter, the method will slice out the rest of the string IV. substring() is not similar to slice() and substring() cannot accept negative indexes. Only II Only IV II and IV Only III JavaScript entities start with _______ and end with _________. Ampersand, semicolon Semicolon, colon Semicolon, Ampersand Ampersand, colon Using _______ statement is how you test for a specific condition. For Switch Select If Why so JavaScript and Java have similar name? JavaScript is a stripped-down version of Java They both originated on the island of Java None of the above JavaScript's syntax is loosely based on Java's How does JavaScript store dates in a date object? None of the above The number of milliseconds since January 1st, 1970 The number of seconds since Netscape's public stock offering The number of days since January 1st, 1900 Which is true about string methods ? I. The indexOf() method returns the index of the first occurrence of a specified text in a string II. The lastIndexOf() method returns the index of the last occurrence of a specified text in a string III. Both the indexOf(), and the lastIndexOf() methods return -1 if the text is not found Only I II and III All I, II, III I and III Which is not an Javascript HTML event onload,onscroll onmouseover, onmouseleave, onmouseenter onclick, onchange, onkeydown, onkeyup None of these Integer Variable is declared using following syntax in JavaScript None of these Var num; Integer num; INT num; _____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation. Native Server-side Client-side Local Consider the following code snippet const pi=3.14; var pi=4; console.log(pi); What will be the output for the above code snippet? Ambiguity Prints 4 This will flash an error Prints 3.14 Which is correct way to get object index value. objectName["propertyName"] objectName.propertyName objectName[“index”] Both A and B What will be output ? function x() { document.write(2+5+"8"); } 7 Error 258 78 What will be output ? Click on this text! function changeText(id) { id.innerHTML = "Ooops!"; } Click on this text! Execute will Blank h1 Error Ooops! What is the correct JavaScript syntax to write "Hello World"? document.write("Hello World") println ("Hello World") System.out.println("Hello World") response.write("Hello World") Which is correct Syntax to sort numerical array alphabetically array is : var points = [40, 100, 1, 5, 25, 10]; I. points.sort(function(a, b){return a - b}); II. points.sort(function(a, b){return b - a}); III. points.sort(); points.reverse(); points.sort(); points.sort(function(a, b){return a - b}); points.sort(function(a, b){return b - a}); What are variables used for in JavaScript Programs? Storing numbers, dates, or other values Causing high-school algebra flashbacks Varying randomly None of the above Time's up