Question discussion

Consider the following code snippet :var a = [1,2,3,4,5];

285229Medium 1 reply 2,076 views
-1
Consider the following code snippet :var a = [1,2,3,4,5];
  • Aslice(0,3);What is the possible output for the above code snippet ?A. Returns [1,2,3]
  • BReturns [4,5]
  • CReturns [1,2,3,4]
  • DReturns [1,2,3,4,5]
Correct answer: A

Discussion 1

0
CCommunity
slice(0,3);
What is the possible output for the above code snippet ?
A. Returns [1,2,3]