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
B. Permit server side, JavaScript code, to connect to RDBMS
Controlled loop constructs
Case checking constructs
Validation constructs
All of the mentioned
var a = [1,2,3,4,5];
a.slice(0,3);
Returns [1,2,3]
Returns [4,5]
Returns [1,2,3,4]
Returns [1,2,3,4,5]
string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
in
exist
within
exists
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));
Yes
No
Runtime error
Compilation error
const obj1 =
{
property1: 21
}
const descriptor1 = Object.getOwnPropertyDescriptor(obj1, 'property1');
console.log(descriptor1.configurable);
console.log(descriptor1.enumerable);
true 21
true false
true true
false false
var string2Num=parseInt(123xyz);
123
123xyz
Exception
NaN
filter and fold
inject and fold
finger and fold
fold
Syntax error
Missing of semicolons
Division by zero
Missing of Bracket
It is mandatory
Not necessary
Few functions return values by default
some functions do not return any value
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()
1
0
Null
Undefined
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
int a=0;
for(a;a<5;a++);
console.log(a);
0
error
4
5
function f() {};
Function f
A custom constructor
Prototype of a function
Not valid
Function prototype
Function literal
Function calling
Function declaration
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
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
true false
false true
true true
false true
Volatile variable
Mutable variable
Immutable variable
Dynamic variable
00
0x
0X
Both 0x and 0X
var grade='B';
var result;
switch(grade)
{
case 'A':
{
result+=10;
break;
}
case 'B':
{
result+= 9;
break;
}
case 'C':
{
result+= 8;
break;
}
default:
result+= 0;
}
document.write(result);
10
9
8
0
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
Identifier and Parentheses
Return type and Identifier
Return type, Function keyword, Identifier and Parentheses
Identifier and Return type
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
will throw errors and exceptions
must be restricted to a Unix Machine only
will work perfectly well on a Windows Machine
will be displayed as a JavaScript text on the browser
The interpreter stops its work
The interpreter throws another exception
The interpreter jumps to the nearest enclosing exception handler
The interpreter throws an error
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
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};
properties
property values
property names
objects
var string1 = 123;
var intvalue = 123;
alert( string1 + intvalue );
123246
246
123123
Exception