Implement list.getitem using valid index for nodejs output