• ThirdConsul@lemmy.zip
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    Pure function = no side effects, no internal state. If you run a pure function twice with the same input, it will give the same output.

    Example of pure function

    (a,b) => a+b
    

    Example of inpure function

    let c;
    
    (a, b) => {
       c++;
       return a+b;
    }