From @Marks who prompted this in the Discord server.
As JS is a dynamic language, it is difficult for code editors (like VSCode and our own code editor on playcanvas.com) to do code completion properly because types of variables aren’t always easy for the editor figure out.
In these cases, we can explicitly describe the type via JSDocs @type attribute as shown here: Use JSDoc: @type