if JS is sychronous why does it not wait for set timeout to complete? code example

Example 1: javascript best way to create synchronous pause in program

console.log("Start");  
console.time("Promise");  
await new Promise(done => setTimeout(() => done(), 5000));  
console.log("End");  
console.timeEnd("Promise");

Example 2: javascript synchronous wait

function delay(n) {  
  n = n || 2000;
  return new Promise(done => {
    setTimeout(() => {
      done();
    }, n);
  });
}

Example 3: wait until a function finishes javascript

function firstFunction(_callback){
    // do some asynchronous work
    // and when the asynchronous stuff is complete
    _callback();    
}

function secondFunction(){
    // call first function and pass in a callback function which
    // first function runs when it has completed
    firstFunction(function() {
        console.log('huzzah, I\'m done!');
    });    
}