advantages and disadvantages of learning

You wouldn’t choose between Javascript and C++ based on which one is harder to learn (though C++ would be by quite a bit) or which one is more useful since they’re totally different languages meant for very different tasks. Javascript is a web browser scripting language that adds functionality to web pages whereas C++ is a full blown systems level language for creating desktop applications that compile to executables. There would be no overlap to their application so you would choose between them solely based on what you hope to do in programming (web pages vs system level applications).

If you’re new to programming in general then neither would be a really good choice, something like Python or Visual Basic would be much better.