Not really a surprise to real developers I guess but to me it was. The addInlineJs method allows you to read a chunk of Javascript from file.
This can be very useful if you need your plugin to insert some Javascript code in a page which is more than a single line.
So normally, as documented, for a single line of Javascript one would do:
$assets->addInlineJs('alert("Hello from My Plugin !")', 1);
But this works too:
$assets->addInlineJs(file_get_contents('user/plugins/my_plugin/alert.j s'), 1);
where the file alert.js contains:
alert("Hello from My Plugin !");
I know, in this overly simple one line example it doesn't make sense but you get the point :)