var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);
7
5
1
9
D. 9
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
make computations in HTML simpler
minimize storage requirements on the web server
increase the download time for the client
increase the loading time of the website
conditional block
block that contains a single statement
both conditional block and a single statement
block that combines multiple statements into a single compound statement
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);
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
var obj=
{
length:20,
height:35,
}
if (breadth' in obj === false)
{
obj.breadth = 12;
}
console.log(obj.breadth);
20
12
undefined
error
debugger
with
if
use strict
Floating numbers
Representation of functions that returns a value
is not present in JavaScript
Form feed
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log(Empty Array);
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
Prints the numbers in the array in order
Prints the numbers in the array in the reverse order
Prints 0 to the length of the array
Prints Empty Array
7.25
-7.25
7
-7
int a=0;
for(a;a<5;a++);
console.log(a);
0
error
4
5
const object1 = {
property1: 20
};
console.log(Object.is(object1));
20
true
false
error
for(var p in o)
console.log(o[p]);
for (var i = 0;i < a.length;i++)
console.log(a[i]);
for (int i = 0;i < a.length;i++)
console.log(a[i]);
for (var i = 0;i <= a.length;i++)
console.log(a[i]);
for (var i = 1;i < a.length;i++)
console.log(a[i]);
int a==2;
int b=4;
int ans=a+b;
print(ans);
2
6
0
error
in
exist
within
exists
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
x = ~-y;
w = x = y = z;
q = a?b:c?d:e?f:g;
x = ~(-y); w = (x = (y = z));
q = a?b:(c?d:(e?f:g));
x = a?b:(c?d:(e?f:g));
q = ~(-y); w = (x = (y = z));
x = (x = (y = z));w = ~(-y);
q = a?b:(c?d:(e?f:g));
x = ~(-y); w = (x = (y = z));
q = (c?d:(e?f:g));
When the function is defined as a looping statement
When the function is defined as expressions
When the function is predefined
when the function is called
var val1=[1,2,3];
var val2=[6,7,8];
var result=val1.concat(val2);
document.writeln(result);
1, 2, 3
Error
1, 2, 3, 6, 7, 8
123
var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);
7
5
1
9
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
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
It returns the value 0
It will throw an exception
It returns the undefined value
It will throw an error
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
Create linkage between client side and server side
Permit server side, JavaScript code, to connect to RDBMS
Support only non relational database
To interpret JavaScript code
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));
12
false
true
error
If the object inherits enumerable properties
The object does not have the properties present in the integer array indices
The delete keyword is never used
Object.defineProperty() is not used
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