var grand_Total=eval(10*10+5);
10*10+5
105 as a string
105 as an integer value
Exception is thrown
C. 105 as an integer value
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
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
in
exist
within
exists
o(x,y);
o.m(x) && o.m(y);
m(x,y);
o.m(x,y);
Returns the value and continues executing rest of the statements, if any
Returns the value and stops the program
Returns the value and stops executing the function
Stops executing the function and returns the value
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
Keywords
Declaration statements
Data types
Prototypes
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
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
const object1 = {
property1: 20
};
console.log(Object.is(object1));
20
true
false
error
int a=0;
for(a;a<5;a++);
console.log(a);
0
error
4
5
Object-Oriented
High-level
Assembly-language
Object-Based
switch(expression)
{
statements
}
==
equals
equal
===
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 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
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]);
<script>
var x = 10;
x *= 5;
document.getElementById("demo").innerHTML = x;
</script>
5
10
50
Error
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
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
!!(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
continue statement
break statement
goto statement
return statement
isPrototypeOf() method
equals() method
=== operator
==opertor
var a= 0;
var b = 0;
while (a < 3)
{
a++;
b += a;
console.log(b);
}
135
123
013
01
It returns the value 0
It will throw an exception
It returns the undefined value
It will throw an error
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
true false
false true
true true
false true
stand-alone expressions
basic expressions containing all necessary functions
contains variable references alone
contains only keywords
debugger
with
if
use strict
function output(object)
{
var place=object ? object.place : Italy;
return clean:+ place;
}
console.log(output({place:India}));
clean:India
clean:Italy
error
undefined