The purpose was not to create a physics engine from scratch., There are already a few good physics engine written for JavaScript by the community (This is one of the reason why I love JavaScript: there is always a .js project for what you want to do ^^).
From the point of view of a web developer, physics engine can give you a lot of cool features among which we can get for instance:
* Realistic simulation of basic shapes (Box, Sphere, compound, etc…)
* Simulation of friction and bounciness
* Link between objects (to simulate chains for instance)
using babylon.js & cannon.js