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