Question d’entretien chez Apptware

Explain the logic behind the Binary Search and write a JavaScript program illustrating the same.