This video takes a look at the new Power BI Embed Sample that you can use to learn how to use the JavaScript API. With code examples and comments to give you a feel for what you need to do.
Report Embed Sample: https://microsoft.github.io/PowerBI-JavaScript/demo/code-demo/index.html