Of course, but we must take into account use-cases where our code is running inside a hook for example (mounted, created etc.), or when dealing with legacy code.
The right thing to do would be refactoring it to fit what you mentioned, but we don't always have that option.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Of course, but we must take into account use-cases where our code is running inside a hook for example (mounted, created etc.), or when dealing with legacy code.
The right thing to do would be refactoring it to fit what you mentioned, but we don't always have that option.