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
B. 2
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
in
exist
within
exists
const obj1 = { property1: '10'};
const obj2 = Object.freeze(obj1);
obj2.property1 = '20';
console.log(obj2.property1);
10
20
Runtime error
Compilation 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]);
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));
12
false
true
error
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
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
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
var arr = [7, 5, 9, 1];
var min = Math.min.apply(null, arr);
document.writeln(min);
7
5
1
9
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
Prints an exception error
Prints an overflow error
Displays Infinity
Prints the value as such
void
int
function
main
var tensquared = (function(x) {return x*x;}(10));
Yes, perfectly
Error
Exception will be thrown
Memory leak
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
prototype stack
prototype chain
prototype class
prototypes
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
Undefined
+
:
^
?:
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
Undefined
Identifier and Parentheses
Return type and Identifier
Return type, Function keyword, Identifier and Parentheses
Identifier and Return type
var a=3.7;
var b=2;
a=ciel(a)
document.writeIn(a*b);
6
7.4
7.5
8
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
var count = 0;
while (count < 10)
{
console.log(count);
count++;
}
The values of count are logged or stored in a particular location or storage
The value of count from 0 to 9 is displayed in the console
An error is displayed
An exception is thrown
directly into JS file and included into HTML
directly on the server page
directly into HTML pages
directly into the css file
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
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
The iterations can be infinite when an interpreter is used
The body of the loop is executed only once
the iteration is finite when an interpreter is used
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
if (!a[i]) continue;
Skips the defined elements
Skips the existent elements
Skips the null elements
Skips the defined & existent elements
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));
2
3
8
error
High level programming language
Assembly level programming language
Machine level programming language
Low level programming language