Beginner here, I have a setTimeout configured something like this that parses json from session storage
setTimeout(() => {
const blog = JSON.parse(sessionStorage.blogs);
console.log(blog);
}, 1000)
all I want to do is use the blog const outside the timeout which would make things easier,
setTimeout(() => {
const blog = JSON.parse(sessionStorage.blogs);
}, 1000)
console.log(blog); <------ this does not work
I get the Undefined error
'blog' is not defined no-undef