- 1
- 2
- 3
- 4
- Next Page »
A Learning Portal from Recruitment India
Which of the following is a disadvantage of using JavaScript?
Workspace
Which type of JavaScript language is ___
Object-Based
Assembly-language
Object-Oriented
High-level
Answer with explanation
Answer: Option AExplanation
Explanation: JavaScript is not a pure OOP’s (object oriented programming) based languages such as PHP, java or many other languages, although it is an object-based language. It is not OOP’s based language, because it doesn’t have three basic properties of object-oriented programming languages, such as polymorphism, encapsulation, and inheritance.
Workspace
What is the correct syntax for referring to an external script called “LFC.js”?
<script source=”LFC.js”>
<script type=”LFC.js”>
<script source=”LFC.js”>
<script src=”LFC.js”>
Answer with explanation
Answer: Option DExplanation
Explanation:The “src” term is used to refer to any JavaScript file. JavaScript.
Workspace
Which of the following explains Cookies nature?
Non Volatile
Transient
Volatile
Intransient
Answer with explanation
Answer: Option BExplanation
Cookies are transient by default; the values they store last for the duration of the web browser session but are lost when the user exits the browser. When a web server has sent a web page to a browser, the connection is shut down, and the server forgets everything about the user.
Workspace
Which property in the Window object is used to refer to a Location object?
area
position
window
location
Answer with explanation
Answer: Option DExplanation
The Window object defines properties like location, which refers to a Location object that specifies the URL currently displayed in the window and allows a script to load a new URL into the window. The window.location object can be used to get the current page address (URL) and to redirect the browser to a new page.
Workspace
What is the code for getting the current time?
var now = new Date(current);
var now = Date();
var now = new Date();
now = new Date();
Answer with explanation
Answer: Option CExplanation
Date() is a predefined function in javascript which returns the date in string form. The above code determines the current time and stores it in the variable “now”.
Workspace
Which is the most appropriate database for developers requiring a huge amount of data?
Database
Datawarehouse
Web databases
Access
Answer with explanation
Answer: Option CExplanation
Developers who need to work with really huge amounts of data like to use databases, and the most recent browsers have started to integrate client-side database functionality into their browsers. Client data base helps in making the website faster and handling the data easier.
Workspace
Among the below given functions, Node supports which of the following client-side timer functions?
getInterval()
Interval()
clearTime()
clearTimeout()
Answer with explanation
Answer: Option DExplanation
Client-side timer functions are used to perform applications based on time constraints. Node supports the client-side timer functions set setTimeout(), setInterval(), clearTimeout(), and clearInterval().
Workspace
Which is a more formal way of importing packages and classes as JavaScript objects?
import(java.util.*);
importClass(java.util.*);
import.Class(java.util.*);
Class.import(java.util.*);
Answer with explanation
Answer: Option BExplanation
Because packages and classes are represented as JavaScript objects, you can assign them to variables to give them shorter names. But you can also more formally import them, if you want to:
import class(java.util.HashMap); // Same as : var HashMap = java.util.HashMap
Workspace
When the “end” event fires on EOF when no more data will arrive, which function is called?
s.on(“data”,f);
s.on(“end”,f);
s.on(“error”,f);
s.on(“default”,f);
Answer with explanation
Answer: Option BExplanation
”EOF” stands for end of file.The above code snippet gets “end” event fired on EOF when no more data will arrive.
Workspace
Consider the below-given syntax
book[datatype]=assignment_value;
In the above syntax, the data type within the square brackets must be
An integer
A String
An object
None of the mentioned
Answer with explanation
Answer: Option BExplanation
When using square bracket notation, the expression inside the square brackets must evaluate to a sting or a value that can be converted to a string.
Workspace
Which is the handler method used to invoke when uncaught JavaScript exceptions occur?
Onhalt
Onerror
Both onhalt and onerror
None of the mentioned
Answer with explanation
Answer: Option BExplanation
The onerror handler method can be registered to be invoked when uncaught JavaScript exceptions occur.
Workspace
What is the function used to remove all handlers for name events?
deleteAllListeners(name)
deleteListener(name,f)
removerListener(name,f)
removeAllListeners(name)
Answer with explanation
Answer: Option DExplanation
The removeAllListeners(name) is used to remove all handlers from name events represented as :
emitter.removeAllListeners(name)
Workspace
The behavior of the instances present of a class inside a method is defined by
Method
Classes
Interfaces
Classes and Interfaces
Answer with explanation
Answer: Option BExplanation
The behavior of the instance of a class is defined by the class and is shared by all instances.
Workspace
The pop() method of the array does which of the following task?
decrements the total length by 1
increments the total length by 1
prints the first element but no effect on the length
None of the mentioned
Answer with explanation
Answer: Option AExplanation
Arrays have a pop() method (it works with push()) that reduces the length of an array by 1 but also returns the value of the deleted element.
Workspace
To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the
isPrototypeOf() method
equals() method
=== operator
none of the mentioned
Answer with explanation
Answer: Option AExplanation
To determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the isPrototype() method. To find out if p is the prototype of o write p.isPrototypeOf(o).
Workspace
What is the outcome of using R along with minification?
Compatibility
More efficient
Sheer file size reduction
File size increase
Answer with explanation
Answer: Option CExplanation
Minification refers to the process of removing unnecessary or redundant data without affecting how the resource is processed by the browser. Sheer file size reduction is the only one aspect of the overall determination got from the R along with the minification.
Workspace
What is the purpose of the Video tab?
To take video of the page
To capture screenshots of the test only
To take video of the test
To capture screenshots of the page
Answer with explanation
Answer: Option DExplanation
The Video tab allows you to capture screenshots of your page as it loads and views them as a video.
Workspace
What does the span of time waiting for the page to be useful depending on?
Runtime performance
Web performance
Speed
Runtime performance & Speed
Answer with explanation
Answer: Option BExplanation
Web performance refers to the speed in which web pages are downloaded and displayed on the user’s web browser. The span of time that you are waiting for the page to be usable depends on web performance.
Workspace
What does the status code 200 indicate?
Error in request
Error in response
Error in server
Successful
Answer with explanation
Answer: Option DExplanation
The status code 200 indicates a successful response from the server. A 400 status code represents a bad request.
Workspace
A linkage of series of prototype objects is called as :
prototype stack
prototype chain
prototype class
prototypes
Answer with explanation
Answer: Option BExplanation
Consider an example, Date.prototype inherits properties from Object.prototype, so a Date object created by new Date() inherits properties from both Date.prototype and Object.prototype. This linked series of prototype objects is known as the prototype chain.
Workspace
Which of the following function of Array object creates a new array with all of the elements of this array for which the provided filtering function returns true?
concat()
every()
filter()
some()
Answer with explanation
Answer: Option CExplanation
filter() − Creates a new array with all of the elements of this array for which the provided filtering function returns true.
Workspace
How does the client and the server communicate following the rules defined by the WebSocket protocol?
Long-lived TCP Socket
Short-lived TCP Socket
UDP Socket
HTTP Socket
Answer with explanation
Answer: Option AExplanation
The client and server communicate over a long-lived TCP socket following rules defined by the WebSocket protocol.
Workspace
What does the usedJsHeapSize property indicate?
Amount of memory used
Amount of memory unused
Amount of memory used & unused
None of the mentioned
Answer with explanation
Answer: Option AExplanation
The usedJsHeapSize property is the amount of memory that all of the current objects in the heap are using.
Workspace
What is the reason for avoiding the attributes property in the HTML DOM?
Found unnecessary
Attributes don’t have attributes
Attributes have attributes
None of the mentioned
Answer with explanation
Answer: Option BExplanation
The reason for avoiding the attributes property in the HTML DOM is because Attributes don’t have attributes.
Workspace
What is the purpose of the userAgent property?
Identifying the data
Identifying the client
Both Identifying the data and client
None of the mentioned
Answer with explanation
Answer: Option BExplanation
The userAgent[] property is a string that contains the code name and version of the browser. This value is sent to the originating server to identify the client.
Workspace