Autocomplete for built in JavaScript functions not working inside custom made functions

I’m experiencing an issue with IntelliSense (autocomplete) in my JavaScript development environment (VS Code). Specifically, autocomplete for built-in JavaScript methods like slice() is not working inside custom functions. While the function itself executes correctly, IntelliSense fails to provide suggestions or autocomplete options when typing . after the variable name within the function. However, the same methods work and are suggested as expected when used outside of custom functions.

See example images:
enter image description here
enter image description here

Tried renaming variables to avoid conflicts with built-in JavaScript names.
Restarted VS Code.
Created a new file to test if the issue persists.