var arr = array('first','second','third');
var newArr = array( 'first', 'first/second', 'first/second/third');
var i, newArr = array[0]; for (i=1; i<array.length; ++i) { newArr[i] = newArr[i-1] + "/" + array[i]; }