var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);
11121314
1112
12345
11
D. 11
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);
70
75
10
error
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
int size=5;
int a=5;
int size=4;
for(int j=size;j>=0;j--)
{
console.log(a);
a=a-2;
}
5555
5321
531-1
531
directly into JS file and included into HTML
directly on the server page
directly into HTML pages
directly into the css file
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
o.m(x) && o.m(y);
o[m](x,y);
o(m)[x,y];
o.m(x && y);
void
int
function
main
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
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
It returns the value 0
It will throw an exception
It returns the undefined value
It will throw an error
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]
Primary Expression
Object Creation Expression
Invocation Expression
Constructor Calling Expression
if (!a[i]) continue;
Skips the defined elements
Skips the existent elements
Skips the null elements
Skips the defined & existent elements
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
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
var string1 = 123;
var intvalue = 123;
alert( string1 + intvalue );
123246
246
123123
Exception
String
Object
Serialized Object
Array
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
const object1 = {
property1: 20
};
console.log(Object.is(object1));
20
true
false
error
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));
<script>
txt1 = “ one”;
txt1 += “two”;
document.getElementById("demo").innerHTML = txt1;
</script>
onetwo
one two
error
undefined
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]);
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
Class, parameters, objects extensible flag
Prototype, class, objects parameters
Prototype, class, objects extensible flag
Native object, Classes and Interfaces and Objects extensible flag
o.m=m.f;
o.m=f;
o=f.m;
o=f;
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
while (a != 0)
{
if (a == 1)
continue;
else
a++;
}
The continue keyword restarts the loop
The continue keyword skips the next iteration
The continue keyword skips the rest of the statements in that iteration
The continue keyword breaks out of the loop