A problem of js inheritance

var a = {0:"A",1:"B",2:"C",length:3};
  var newa = Array.prototype.slice.call(a);
  console.log(newa);

my understanding of this example is that the an object inherits and executes Array"s slice method, but the slice method does not pass parameters, so why print it out as a ["A", "B", "C"] array?

Feb.27,2021

The

slice method returns the original array without arguments.

  slice  all array elements are intercepted by default without passing parameters 

Menu