Crossing platform is good, but not good enough. Programming in C++ is super slow, in the other hand, C++ code cannot run on web browsers. That’s why we add javascript binding. We can pack javascript code into:

native app on cocos2d-x + SpiderMonkey, which can parse javascript code into C.

web app on cocos2d-html5

We have a same API set on cocos2d-x and cocos2d-html5. Therefore, we can create 100% javascript game natively in cocos2d-x. When you want to run it on browsers, want you need is only switch engine to cocos2d-html5, without modifying your source code.