Pure functions!

PHOTO EMBED

Thu Jun 24 2021 16:18:30 GMT+0000 (Coordinated Universal Time)

Saved by @hisam #array #destructuring #javasc #react.js

//What are pure functions?
//Pure functions take an input value (a parameter or argument) and produce an output value. //Like with hashing, the same input it will always return the same output 

const myPureFunction = number => return number * 4

//Pure functions must:
//1. Contain no side effects
//2. When given the same input, return the same output.
// A pure component avoids any use of state.
map
filter
reduce
content_copyCOPY