What will be the possible output of the following JavaScript code?
var a = [1,2,3,4,5];
a.slice(0,3);
a) Returns [1,2,3]
b) Returns [4,5]
c) Returns [1,2,3,4]
d) Returns [1,2,3,4,5]
Answer: a
Explanation: .slice() function is a predefined function in JavaScript used to keep the elements from starting point and ending point mentioned in the function argument. The elements after the ending point and before the starting point are not shown.
Related Posts
What are the portability concerns founded in Seeheim model?
Which of the following is the main task accomplished by the user?
Which among the following are the functions that any system with a user interface must provide?
The _____________ system is widely used for mapping from Java objects to relations.
The ______________ layer, which provides the interface between the business-logic layer and the underlying database.
The _____________ layer, which provides a high-level view of data and actions on data.
Which layer deals which deals with user interaction is called _____________ layer.
Join The Discussion