you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 2 months ago (1 child)

Pure function, is that a functional programming lingo

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 months 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;
    } 
    
  • source
  • parent