November 7, 2016 0 Welcome to your JavaScript Name Using _______ statement is how you test for a specific condition. For If Switch Select Which of the following best describes JavaScript? a low-level programming language. a compiled scripting language an object-oriented scripting language a scripting language precompiled in the browser Which of the following is not a valid JavaScript variable name? _first_and_last_names None of the above 2names FirstAndLast Which of the following can't be done with client-side JavaScript? Sending a form's contents by email Storing the form's contents to a database file on the server None of the above Validating a form What will be output ? Click on this text! function changeText(id) { id.innerHTML = "Ooops!"; } Execute will Blank h1 Error Click on this text! Ooops! Why so JavaScript and Java have similar name? They both originated on the island of Java JavaScript is a stripped-down version of Java None of the above JavaScript's syntax is loosely based on Java's How to create a Date object in JavaScript? dateObjectName Date([parameters]) dateObjectName := new Date([parameters]) dateObjectName = new Date([parameters]) dateObjectName.new Date([parameters Which is correct way to get object index value. objectName[“index”] Both A and B objectName["propertyName"] objectName.propertyName What are variables used for in JavaScript Programs? Varying randomly Causing high-school algebra flashbacks None of the above Storing numbers, dates, or other values What is the correct JavaScript syntax to write "Hello World"? response.write("Hello World") println ("Hello World") document.write("Hello World") System.out.println("Hello World") Integer Variable is declared using following syntax in JavaScript None of these Var num; INT num; Integer num; 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 All I, II, III I and III Only I II and III 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 3.14 This will flash an error Prints 4 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}); When a user views a page containing a JavaScript program, which machine actually executes the script? A central machine deep within Netscape's corporate offices The Web server None of the above The User's machine running a Web browser 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 undefined y is not declared defined Value of y is 3.14 None of the above To change the style of an HTML element correct Syntax is document.getElementById(id).style.property=new style document.getElementById(id).Css= New property document.getElementByClass(id).Css.style.property=new style document.getElementByClass(Class).style.Val=new Property What is the special feature of the modern web applications? c. d. Can alter contents without loading document None of the mentioned Both a and b Must load the document to manipulate Choose the server-side JavaScript object? File Function FileUpLoad Date 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 III II and IV Only IV Only II Which is not an Javascript HTML event onload,onscroll onmouseover, onmouseleave, onmouseenter None of these onclick, onchange, onkeydown, onkeyup 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 Only IV I and III only Only III All are True JavaScript entities start with _______ and end with _________. Ampersand, semicolon Semicolon, Ampersand Ampersand, colon Semicolon, colon _____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation. Client-side Server-side Native Local What will be output ? function x() { document.write(2+5+"8"); } Error 7 258 78 How does JavaScript store dates in a date object? None of the above The number of seconds since Netscape's public stock offering The number of milliseconds since January 1st, 1970 The number of days since January 1st, 1900 Time's up