//
//  Collection.swift
//  MockuprViewer
//
//  Created by Sergii Kryvoblotskyi on 3/30/21.
//

import Foundation

extension Array where Element : Equatable {
    
    func byRemoving(element: Element) -> [Element] {
        var collection = self
        collection.removeAll(where: { $0 == element })
        return collection
    }
    
    func byAppending(element: Element) -> [Element] {
        var collection = self
        collection.append(element)
        return collection
    }
}
