// delete delete a target data by index.
delete delete a target data by index.
// delete delete a target data by index .
func (a *Array) delete(index int) (string, error) {
	if index >= a.length {
		return "", errors.New("out of index range")
	}
	v := a.data[index]
	for i := index; i < a.length-1; i++ {
		a.data[i] = a.data[i+1]
	}
	a.data[a.length-1] = ""
	a.length--
	return v, nil
}
func ( a * Array ) delete ( index int ) ( string , error ) { if index >= a . length { return " " , errors . New ( " " ) } v := a . data [ index ] for i := index ; i < a . length - 1 ; i ++ { a . data [ i ] = a . data [ i + 1 ] } a . data [ a . length - 1 ] = " " a . length -- return v , nil }
delete delete a target data by index.
delete delete a target data by index .
// target value for deleting // unset // update the length