JSFiddle - React, Tailwind, and code Playground
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)