Type checking. Basically, you force the code to assume that name is a string, and amount is a number, so autocomplete gives you the correct members for that variable.
This is called type checking, basically it tells the code that the variable name is supposed to be a string instead of the default any(meaning any possible type). This helps to catch common non-runtime coding errors early on without having to run the code, however it won’t change the behaviour of the code itself.
So type checking doesn’t prevent any errors from occurring or change code behaviour. It just warns the programmer about said type checking errors by redlining the code within the script editor and in a way “annoying” them till they fix the issue.
Type checking is highly useful for organizing code, helping other programmers decode what you did and for even helping your future self when revisiting your code.