Pergunta de entrevista da empresa Xorance

What is the significance of, and reason for, wrapping the entire content of a JavaScript source file in a function block?