Similar to the Managed CSOM, the JS CSOM also is built to batch requests to ensure performance. However, one of the fundamental differences is that the JS CSOM is designed with asynchronous calls and callbacks in mind. This ensures that transactions that take some time to complete don’t potentially block the calling thread, possibly impacting the UI of your application.
To access the JS CSOM the calling page must reference the following two files:
Each of these is located in the /_layouts/15/ directory under each SharePoint site; for example, http://myserver/sitename/_layouts/15/SP.js.
You can also find these files on any SharePoint 2013 server in the following location:
%ProgramFiles%\Common Files\Microsoft Shared\ web server extensions\15\TEMPLATE\LAYOUTS