We often end up with this scenario when writing plain JavaScript. We write a function, we know the expected type, but the text editor doesn't know which type it can be! So it can't provide autocomplete suggestions.
An easy solution would be to use type annotations. In this example I have used JS Doc style annotation which VS Code understands.
By annotating a parameter, we are able to unlock the type specific methods and properties in the autocomplete.
#vscode #javascript #typescript #webdevelopment #developer #html #css #html5 #microsoft #google #programming #softwaredeveloper #programming