I am a bit confused with the console output , my understading is that if we write the function name in the console it will display only if there is a return exisit and in this casue it will either display [ ] or parsed value that is equal to z1 but rather it shows the whole arrow function.
am i missing something here, if someone can please clarify please.
let finalbuyitems = () => {
let z1 = JSON.parse(window.localStorage.getItem("user-final") || "[]");
console.log(z1);
return z1;
};
console.log(finalbuyitems); // console output below
function App() {
const [finalBuy, setfinalBuy] = useState(finalbuyitems());
console output below