function clearSmartArrayFromType(arr, type_to_clear) {
    var is_need_compact = false

    for (var i = 0, total_size = arr.length; i < total_size; i++) {
      if (typeof arr[i] !== 'undefined') {
        if (arr[i].clear && arr[i].clear === type_to_clear) {
          delete arr[i]
          is_need_compact = true
        } // Endif.
      } // Endif.
    } // End of for loop.

    if (is_need_compact) {
      compactArray(arr)
    } // Endif.
  }
Remove selected records from the given array.

This method destroys records inside the given array of the given type.

@param {object} arr The array to work on it.
@param {object} type_to_clear The type of records to clear.