Are these two equivalent? If not which is best and why?
const [count, setCount] = useState(initialCount);
Both examples are valid and work the same. However, I suspect that a primitive operates the same as a function because JavaScript supports first-class/higher order functions. This means that functions are threated as any other variables, allowing to pass them as arguments, assign them to variables, and return them within any other function.