Pergunta de entrevista da empresa Atishay

Can you explain the difference between synchronous and asynchronous programming in JavaScript? Can you give examples of when to use each?