We created JavaScript to run complex code in the web browser.<p>This worked well, until someone went – hey, we should also use this cool language on the server side. So node.js was born, and it added extra APIs for stuff like filesystem access and web servers that the V8 sandbox didn't allow.<p>Then someone went – hey, wouldn't it be neat to run all this cool node.js code in the browser? So Nodebox and Webcontainers were born that wrote a compatibility layer and added pollyfills for all the node.js-specific APIs that were missing in V8, and so some of this code was able to run in the browser.<p>My question is – why couldn't all this code run directly on the browser in the first place without Node.js and Nodebox?