o.m(x) && o.m(y);
o[m](x,y);
o(m)[x,y];
o.m(x && y);
B. o[m](x,y);
o = {x:1, y:{z:[false,null,]}};
s = JSON.stringify(o);
p = JSON.parse(s);
Object Encapsulation
Object Serialization
Object Abstraction
Object Encoding
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
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);
70
75
10
error
src
ext
script
link
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
stand-alone expressions
basic expressions containing all necessary functions
contains variable references alone
contains only keywords
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};
properties
property values
property names
objects
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
directly into JS file and included into HTML
directly on the server page
directly into HTML pages
directly into the css file
const obj1 = { property1: '10'};
const obj2 = Object.freeze(obj1);
obj2.property1 = '20';
console.log(obj2.property1);
10
20
Runtime error
Compilation error
function f() {};
Function f
A custom constructor
Prototype of a function
Not valid
The interpreter stops its work
The interpreter throws another exception
The interpreter jumps to the nearest enclosing exception handler
The interpreter throws an error
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));
12
false
true
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
Identifier and Parentheses
Return type and Identifier
Return type, Function keyword, Identifier and Parentheses
Identifier and Return type
Ignores the statement
Prompts to complete the statement
Throws an error
Shows a warning
Function prototype
Function literal
Function calling
Function declaration
Keywords
Declaration statements
Data types
Prototypes
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
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
prototype stack
prototype chain
prototype class
prototypes
The interpreter stops its work
The interpreter throws another exception
The interpreter jumps to the nearest enclosing exception handler
The interpreter throws an error
125
25
5
Error
1.01
1.047
1.00
1.4
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]);
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
return a localised object representation
return a parsed string
return a local time in the string format
return a localized string representation of the object
var a=3.7;
var b=2;
a=ciel(a)
document.writeIn(a*b);
6
7.4
7.5
8
o.m=m.f;
o.m=f;
o=f.m;
o=f;