Why this code does not work
I want to learn the synchronization in the easy way
const post = [];
function getPost(post) {
console.log(post)
}
async function createPost (post) {
await setTimeout(() => {
post.push({
name: "John", work: "Developer"
})
}, 1000)
getPost(post);
}
createPost(post);