• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JavaScript by
Q:
Why is it common to wrap the content of JavaScript source file in a function book?

1 Answer

0 votes
by

Many JavaScript libraries use this technique. It helps to develop a closure around the contents of the file which helps to create a private namespace and hence, avoid any name clash with different JavaScript modules and libraries. 

Related questions

0 votes
asked Sep 19, 2021 in JavaScript by sharadyadav1986
0 votes
asked Dec 11, 2020 in JavaScript by SakshiSharma
...