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
B. 9
filter and fold
inject and fold
finger and fold
fold
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
<script>
txt1 = “ one”;
txt1 += “two”;
document.getElementById("demo").innerHTML = txt1;
</script>
onetwo
one two
error
undefined
function output(object)
{
var place=object ? object.place : Italy;
return clean:+ place;
}
console.log(output({place:India}));
clean:India
clean:Italy
error
undefined
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
var values=[1,2,3,4]
var ans=values.slice(1);
document.writeln(ans);
1, 2, 3, 4
2, 3, 4
1, 3, 4
error
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
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
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
Undefined
String
Object
Serialized Object
Array
const obj1 = { property1: '10'};
const obj2 = Object.freeze(obj1);
obj2.property1 = '20';
console.log(obj2.property1);
10
20
Runtime error
Compilation error
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));
2
3
8
error
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
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
!!(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
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
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
void
int
function
main
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
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]);
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));
12
false
true
error
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
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
It is mandatory
Not necessary
Few functions return values by default
some functions do not return any value
int a=0;
for(a;a<5;a++);
console.log(a);
0
error
4
5
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]
switch(expression)
{
statements
}
==
equals
equal
===
the head tag
the head or body
the title or head
after the body tag
[digits][.digits][(E|e)[(+|-)]digits]
[digits][+digits][(E|e)[(+|-)]digits]
[digits][(E|e)[(+|-)]digits]
[.digits][digits][(E|e)[(+|-)]digits]
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