One habit
Before you use a value, ask two questions: what type is it, and can it be missing? Most JavaScript bugs in student projects start when code assumes an input is a number, string, or object without checking.
Values have types
JavaScript values can be strings, numbers, booleans, undefined, null, objects, and functions. You meet them when reading form inputs, URL params, localStorage, and API responses.
Use typeof for a first check. Remember that form inputs usually arrive as strings, even when the user typed 499. That matters if you are building a fee splitter, event budget app, or UPI expense tracker.