﻿function pop()
{
   return( this.data.pop() );
}
function push( value )
{
  this.data.push( value );
}

function getAt(index)
{
    return this.data[index];
}

function insertAt( index, value )
{
  var part1 = this.data.slice( 0, index );
  var part2 = this.data.slice( index );
  part1.push( value );
  this.data = part1.concat( part2 );
}

function removeAt( index )
{
  var part1 = this.data.slice( 0, index );
  var part2 = this.data.slice( index );
  part1.pop();
  this.data = part1.concat( part2 );
}

function size()
{
  return( this.data.length );
}

function List()
{
this.data = new Array( 0 );
this.pop = pop;
this.push = push;
this.size = size;
this.insertAt = insertAt;
this.removeAt = removeAt;
this.getAt = getAt;
}
