JSFiddle - React, Tailwind, and code Playground

by Julien Etienne

JavaScript

yconst x = value =>  void(console.log(value))
const y = value => 200

let statefulValue

const state = x => {
 const newValue = x(statefulValue)
     if (newValue !== undefined) {
         statefulValue = newValue
     		 console.log(statefulValue)
     }
}


state(x) // Undefined
state(y)