var str = "Str"; var num = 10; var output = str + num;
What will be the value of Variable 'output' ?
Nothing will be printed
Str10
Null
NaN
Underscore can be used as first letter while declaring variable in JavaScript.
False
True
Why JavaScript is called as Lightweight Programming Language ?
because JS is available free of cost.
because JS is client side scripting
because we can add programming functionality inside JS
because JS can provide programming functionality inside but up to certain extend.
JavaScript is ideal to
make computations in HTML simpler
minimize storage requirements on the web server
increase the download time for the client
none of the mentioned
A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .
JavaArray
JavaClass
JavaObject
JavaPackage
JavaScript entities start with _______ and end with _________.
Semicolon, colon
Semicolon, Ampersand
Ampersand, colon
Ampersand, semicolon
A statement block is a
conditional block
block that contains a single statement
Both conditional block and single statement
block that combines multiple statements into a single compound statement
<html> <body> <script type="text/javascript"> <!-- document.print("Hello"); //--> </script> </body> </html>
What will be the Output of the above Code ?
Will Throw Error
Will not print anything because of Comment.
Hello
None of These
Which of the following is not a compound assignment operator.
===
+=
>>=
JavaScript is interpreted by _________
Client
Server
Object
None of the above
/* This is Simple Comment */
This is the example of ____________ Comment.
Single Line Comment
Multiple Line Comment
In March 1996, _______________ was released, featuring support for JavaScript.
Netscape Navigator 1.0
Internet Explorer 2.0
Netscape Navigator 2.0
Internet Explorer 1.0
When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type ___________
ScriptObject
JSObject
Jobject
Which of the following navigator object properties is the same in both Netscape and IE?
navigator.appCodeName
navigator.appName
navigator.appVersion
Java Script have following type of Comment(s) -
Single Line Comment/Multiple Line Comments
Enhanced Comments
HTML Style Comment
All the Above
JavaScript Code is written inside file having extension __________.
.jvs
.javascript
.js
.jsc
State the correct place of JS Code inside HTML -
Inside Body
Inside Head
Inside Single JavaScript File
All of these
Variable declared outside JavaScript Function is called as _______________ .
Global Variable
Local Variable
What does the tag do?
Enclose text to be displayed by non-JavaScript browsers.
Prevents scripts on the page from executing.
Describes certain low-budget movies.
Variable declared inside JavaScript Function will be called as ____________.
Global Variables
Local Variables
JSON strings have to be in
single quote
double quote
single quote or double quote
<html> <body> <script> var x = 12.45; var y = 1; var z = '8' + x + y; document.write(z + "<br>"); </script> </body> </html>
Value of Z is
21.450
21.451
812.451
813.451
JSON name/value pair is written as
name’ : ‘value’
name = ‘value’
name = “value”
“name” : “value”
Non Initialized Variable have value "undefine", What value be printed in following case.
var carname="Volvo"; var carname;
undefined
Error
Volvo
null
What will be the value of Variable - "num3" ?
var num1; var num2 = 10; var num3 = num1 + num2;
10
undefine10
undefine
None of these
The _______ method of an Array object adds and/or removes elements from an array.
Reverse
Shift
Slice
Splice
Integer Variable is declared using following syntax in JavaScript.
Integer num;
var num;
int num;
integer num;
To enable data tainting, the end user sets the _________ environment variable.
ENABLE_TAINT
MS_ENABLE_TAINT
NS_ENABLE_TAINT
ENABLE_TAINT_NS
In the below notation, Employee is of type { “Employee”: [ “Amy”, “Bob”, “John” ] }
Not a valid JSON string
Array
Class
JavaScript is _________ language.
Programming
Application
Scripting
In multiple line comment , End of the comment is specified by ________ Symbol.
//
*/
*
\
The statement a===b refers to
Both a and b are equal in value, type and reference address
Both a and b are equal in value
Both a and b are equal in value and type
There is no such statement
When you assign a text value to a variable, we put text value in the pair of _________.
Single/Double Quote
Square Bracket
Guess the ternary operator used in the following example !!!
marks = (mark<35)?"Fail":"Pass";
Conditional Operator
Logical Operator
Bitwise Operator
Colon Operator
JS Comment can be used for following purposes
to Hide Non-usable line.
to Hide Non-usable Multiline Code
used for Documentation
<script type="text/javascript"> var name; name = "Pritesh"; </script> <script type="text/javascript"> document.write(name); </script>
What will be the output of the following ?
Pritesh
JavaScript Statements are executed by ________ .
JVM
Compiler
Browser
Using _______ statement is how you test for a specific condition.
Select
If
Switch
For
The escape sequence ‘f’ stands for
Floating numbers
Representation of functions that returns a value
f is not present in JavaScript
Form feed
JavaScript syntax to change the content of the following HTML code
document.getElement (“documentId”).innerHTML = ”Hi Welcome”;
document.getElementById(“documentId”).innerHTML = ”Hi Welcome”;
document.getId(“documentId”).innerHTML = ”Hi Welcome”;
document.elementById(“documentId”).innerHTML = ”Hi Welcome”;
To set up the window to capture all Click events, we use which of the following statement?
window.captureEvents(Event.CLICK);
window.handleEvents (Event.CLICK);
window.routeEvents(Event.CLICK );
window.raiseEvents(Event.CLICK );
_________ is a wrapped Java array, accessed from within JavaScript code.
Which of the following operators not comes under assignment Operator ?Select all possible options.
=
%=
==
JavaScript Code can be called by using _________.
Function / Method
RMI
Preprocessor
None Of thease
What will be printed on the screen ? Var3 =100101010
1001020
130
10030
100101010
Java Statement terminated by ______________ ,
Slash
Semicolon
Full Stop
Comma
Single Line Comment Starts with _________ Symbol.
"\"
"//"
"$$"
"#"
The development environment offers which standard construct for data validation
Super controlled loop constructs
Case sensitivity check
Validation constructs
All of the mentioned
Local Variables are Destroyed as soon as ______________.
Control comes outside the method
User closes the browser
Page gets completely loaded
<html> <body> <script> var x = 5; var y = 6; document.write((x + y) + "<br>"); </script> </body> </html>
What will be the output of the following code ?
56
No Output
11
It is good to include JS code inside footer section in order to speed up the Page loading time of Webpage.
Which of the following function of Array object returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found?
indexOf()
join()
lastIndexOf()
map()
One of the special features of an interpreter in reference with the for loop is that ___________
Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
The iterations can be infinite when an interpreter is used
The body of the loop is executed only once
the iteration is finite when an interpreter is used
What type of value gets printed if we add following two variables.
var a = "1"; var b = 5;
Integer
Long
Number
Text
Which was the first browser to support JavaScript ?
Mozilla Firefox
Google Chrome
IE
Netscape
Which of the following function of String object causes a string to be italic, as if it were in an tag?
fixed()
fontcolor()
fontsize()
italics()
"+=" operator can operate on following data values.
Float
String
All Options
What will be the output of the following script ?
<!DOCTYPE html> <html> <body> <script> var x = 5; document.write(x === "5"); </script> </body> </html>
5
1
The syntax of Eval is ________________
[objectName.]eval(numeri).
[objectName.]eval(string)
[EvalName.]eval(string)
[EvalName.]eval(numeri).
function message() { var name = "Pritesh"; alert(name); }
Variable declared above is example of ___________ Variable.
Global
Local
Variable name contain following type of characters -1. Alphabet2. Digits3. Underscore4. Special ChractersSelect the correct option.
3 4 2
4 3 1
1 2 3 4
1 2 3
Which of the following is not an logical operator ?
&&
||
!
|
Initialization of variable can be done by writing _____ operator in between variable name and operand value.
VALUE
EQUALS
Group of JavaScript Statements is called as _________.
Statement Block
Group
Cluster
Code Block
<script language="javascript"> function x() { document.write(2+5+"8"); } </script>
What is the output?
258
7
78
Microsoft Developed a compatible dialect of JavaScript called _____________.
JScript.
MS JavaScript
MJavaScript
Advanced JavaScript
Which JavaScript variable cannot be used as First character but can be use after first character ?
Asterisk
Dollar Sign
Underscore
Digit
We can declare ___________ at a time. Select most appropriate option.
One Variable Only
More than One Variables
One or more Variables
The type of a variable that is volatile is
Volatile variable
Mutable variable
Immutable variable
Dynamic variable
"Add and Assignment" operator is shown by this symbol.
+==
==+
=+
The generalised syntax for a real number representation is
[digits][.digits][(E|e)[(+|-)]digits].
[digits][+digits][(E|e)[(+|-)]digits].
[digits][(E|e)[(+|-)]digits].
[.digits][digits][(E|e)[(+|-)]digits].
Multiple Declarations of variables are separated by ___________ symbol
Colon
Consider the following statements
switch(expression) { statements }
In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?
equals
equal
<html> <body> <script> var name = "John Doe"; var name = 123; document.write(name + "<br>"); </script> </body> </html>
Is it possible to change the type of value after re-assignment.
Yes !! It is possible.
It can be possible if variable is assigned with interger value.
No
Spaces,Punctuation marks are called as __________ Symbols in JavaScript.
Special
Punctual
Mandetory
Which of the following is not a JSON type?
Date
JavaScript is Case Sensitive !!Say True or False
Variable declared without a value will have the value ______________.Eg.
0
To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?
user_pref(" javascript.console.open_on_error", false);
user_pref("javascript.console.open_error ", true);
user_pref("javascript.console.open_error ", false);
user_pref("javascript.console.open_on_error", true);
Which of the following attribute can hold the JavaScript version?
LANGUAGE
SCRIPT
VERSION
<script type="text/javascript"> { document.write("<h1>This is a heading</h1>"); document.write("<p>This is a paragraph.</p>"); document.write("<p>This is another paragraph.</p>"); } </script>
HTML Tags are allowed inside JS. Is this error free code ?
Yes
All modern browsers supports JS.
Which is a more efficient code snippet ?
Code 1 :
for(var num=10;num>=1;num--) { document.writeln(num); }
Code 2 :
var num=10; while(num>=1) { document.writeln(num); num++; }
Code 1
Code 2
Both Code 1 and Code 2
Cannot Compare
JavaScript is invented by ________.
Brendan Eich
Helsinki, Linus
W3 Group
James Gosling
What is the correct syntax for referring to an external script called " abc.js"?
+Infinity in JS gets added with +Infinity then output of the code will be -
+Infinity
-Infinity
The JavaScript exception is available to the Java code as an instance of __________
netscape.javascript.JSObject
netscape.javascript.JSException
netscape.plugin.JSException
<script src="../main.js"></script>
This code will include External JS inside your webpage.
Which types of image maps can be used with JavaScript?
Server-side image maps
Client-side image maps
Server-side image maps and Client-side image maps
JavaScript is a _______________ language
Object-Oriented
High-level
Assembly-language
Object-Based
Which of the following Attribute is used to include External JS code inside your HTML Document -
link
script
src
ext
Which of the following statement is used to declare variable in JavaScript ?
Assignment Statement
Conditional Statement
Executable Statement
Declaration Statement
The script tag must be placed in
head
head and body
title and head
all of the mentioned
The “var” and “function” are
Keywords
Declaration statements
Datatypes
Prototypes
Is it possible to nest functions in JavaScript?
A hexadecimal literal begins with
00
0x
0X
Both 0x and 0X
What will be printed inside webpage ?
var message="Hello JS"; document.write(Message);
It will crash browser since No Error handler is provided.
Hello JS
"Hello JS" will be printed multiple times
Nothing Will be printed because Code is not error free
Executable single line of Script is called as _________________.
Statement in JavaScript
Breakpoint in JS
Line in JS
Triggering Event
<!DOCTYPE html> <html> <body> <script> var x = "5"; var y = 6; var z = x + y; document.write(x + "<br>"); document.write(y + "<br>"); document.write(z + "<br>"); </script> </body> </html>
Guess output of the following code.
5 6 11
5 6 10
5 6 56