CONTACT US

    The reduce ({…spread}) anti-pattern

    A young man with short dark hair smiles slightly at the camera. He is wearing a crew-neck shirt and the background is plain and light-coloured.
    • reduce …spread belongs to a different complexity class than the optimal solutions, which is bad
    • javascript engines will probably never optimize this code
    • if you’re using reduce …spread for reasons of immutability, you should copy once or use immutable helper libraries

    Article link copied

    Close button