the head tag
the head or body
the title or head
after the body tag
B. the head or body
function tail(o)
{
for (; o.next; o = o.next) ;
return o;
}
No, this will throw an exception as only numerics can be used in a for loop
No, this will not iterate
Yes, this will work
No, this will result in a runtime error with the message Cannot use Linked List
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
debugger
with
if
use strict
function equalto()
{
int num=10;
if(num===10)
return true;
else
return false;
}
true
false
runtime error
compilation error
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));
2
3
8
error
An integer
A String
An object
Floating point
var text = testing: 1, 2, 3; // Sample text
var pattern = /d+/g // Matches all instances of one or more digits
text==pattern
text.equals(pattern)
text.test(pattern)
pattern.test(text)
function printprops(o)
{
for(var p in o)
console.log(p + : + o[p] +
);
}
Prints the contents of each property of o
Returns undefined
Prints only one property
Prints the address of elements
var tensquared = (function(x) {return x*x;}(10));
Yes, perfectly
Error
Exception will be thrown
Memory leak
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
var grand_Total=eval(10*10+5);
10*10+5
105 as a string
105 as an integer value
Exception is thrown
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);
70
75
10
error
High level programming language
Assembly level programming language
Machine level programming language
Low level programming language
Keywords
Declaration statements
Data types
Prototypes
RMI
Triggering Event
Preprocessor
Function/Method
string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
Volatile variable
Mutable variable
Immutable variable
Dynamic variable
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};
properties
property values
property names
objects
Reverses and stores in the same array
Reverses and concatenates the elements of the array
Reverses
Stores the elements of an array in normal order
stand-alone expressions
basic expressions containing all necessary functions
contains variable references alone
contains only keywords
function constfuncs()
{
var funcs = [];
for(var i = 0; i < 10; i++)
funcs[i] = function() { return i; };
return funcs;
}
var funcs = constfuncs();
funcs[5]()
9
0
10
None of the mentioned
function compare()
{
int a=1;
char b=1;
if(a.tostring()===b)
return true;
else
return false;
}
true
false
runtime error
logical error
decrements the total length by 1
increments the total length by 1
prints the first element but no effect on the length
updates the element
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
a.shift();
1
[4,5]
[3,4,5]
Exception is thrown
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
true false
false true
true true
false true
o.m=m.f;
o.m=f;
o=f.m;
o=f;
Returns the value and continues executing rest of the statements, if any
Returns the value and stops the program
Returns the value and stops executing the function
Stops executing the function and returns the value
Controlled loop constructs
Case checking constructs
Validation constructs
All of the mentioned
var o = new Object();
var o = Object();
var o;
var o= new Object;
Object o=new Object();