JSFiddle - React, Tailwind, and code Playground

JavaScript

function List() {}
List.prototype = new Array();

var a= new List();
a[0] = "first";
a.length = 1;
a[1] = "second"
a.length = 2;
a.push("third");
var x=[];
for (var y in a){
  if (a.hasOwnProperty(y)) x.push([y,a[y]]);   
}
document.write( JSON.stringify( x ) )