!!(obj1 && obj2);
(obj1 && obj2);
Both the lines result in a boolean value True
Both the lines result in a boolean value False
Both the lines checks just for the existence of the object alone
The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
D. The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
stand-alone expressions
basic expressions containing all necessary functions
contains variable references alone
contains only keywords
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
true false
false true
true true
false true
int a=1;
if(a!=null)
return 1;
else
return 0;
1
0
runtime error
compiler error
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);
11121314
1112
12345
11
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};
properties
property values
property names
objects
switch(expression)
{
statements
}
==
equals
equal
===
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 height()
{
var height = 123.56;
var type = (height>=190) ? tall : short;
return type;
}
123.56
190
tall
short
var txt1 = good;
var txt2 = day;
document.getElementById(demo).innerHTML = txt1 + txt2;
good day
goodday
error
undefined
!!(obj1 && obj2);
(obj1 && obj2);
Both the lines result in a boolean value True
Both the lines result in a boolean value False
Both the lines checks just for the existence of the object alone
The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
function f(o)
{
if (o === undefined) debugger;
}
It does nothing but a simple breakpoint
It debugs the error in that statement and restarts the statements execution
It is used as a keyword that debugs the entire program at once
It is used to find error in the statement
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
RMI
Triggering Event
Preprocessor
Function/Method
Function prototype
Function literal
Function calling
Function declaration
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 grade='A';
var result;
switch(grade)
{
case 'A':
result+=10;
case 'B':
result+= 9;
case 'C':
result+= 8;
default:
result+= 0;
}
document.write(result);
10
27
8
0
<script>
var x = 10;
x *= 5;
document.getElementById("demo").innerHTML = x;
</script>
5
10
50
Error
Procedures
Method
Static function
Dynamic function
string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
<script>
document.getElementById("demo").innerHTML = typeof "John"
</script>
integer
number
string
error
make all of the own properties of that object non configurable
to configure and bring a writable property
lock down objects into a known state and prevent outside tampering
to include new properties into the object
var values=[one,two,Three];
var ans=values.shift();
document.writeln(ans);
one
two
three
error
o.m(x) && o.m(y);
o[m](x,y);
o(m)[x,y];
o.m(x && y);
const object1 = {};
a = Symbol('a');
b = Symbol.for('b');
object1[a] = 'harry';
object1[b] = 'derry';
const objectSymbols = Object.getOwnPropertySymbols(object1);
console.log(objectSymbols.length);
0
2
1
Error
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
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);
4
1
Error
0
var add=new Function(num1,num2,return num1+num2);
document.writeln(add(2,5));
2
5
Error
7
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);
4
1
Error
0
for(var num=10;num>=1;num--)
{
document.writeln(num);
}
var num=10;
while(num>=1)
{
document.writeln(num);
num++;
}
Code 1
Code 2
Both Code 1 and Code 2
Cannot Compare