Fungsi Sinkronisasi JavaScript

let x = 0;
x = setTimeout(() => {
    ++x;
    console.log(x);
    return x;
}, 1000);
console.log(x);
Thoughtless Turkey