You are viewing a single comment's thread. Return to all comments →
def end_arr_delete(arr) deleted_element = arr.pop deleted_element end
def start_arr_delete(arr) deleted_element = arr.shift deleted_element end
def delete_at_arr(arr, index) deleted_element = arr.delete_at(index) deleted_element end
def delete_all(arr, val) arr.delete(val) end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby Array - Deletion
You are viewing a single comment's thread. Return to all comments →
def end_arr_delete(arr) deleted_element = arr.pop deleted_element end
def start_arr_delete(arr) deleted_element = arr.shift deleted_element end
def delete_at_arr(arr, index) deleted_element = arr.delete_at(index) deleted_element end
def delete_all(arr, val) arr.delete(val) end