Library › Book 12 › Variables and Types
Variables and Types
2.1🔒Declaring VariablesCommon Mistake: In JavaScript and TypeScript, always use const by default. Only use let when you need to reassign. Never use var -- it has…
2.2🔒StringsStrings hold text: test names, URLs, log messages, API responses.
2.3🔒NumbersNumbers represent status codes, response times, retry counts, and thresholds.
2.4🔒BooleansBooleans represent test pass/fail, feature flags, and condition checks.
2.5🔒None, null, undefinedThe "nothing" value. This concept catches more QA bugs than almost anything else.
2.6🔒Type Annotations (Python and TypeScript)Both Python and TypeScript support type annotations. They catch bugs before your tests run.
2.7🔒Exercises: Chapter 2Easy: Create variables for a test case: name (string), expected status (number), actual status (number), passed (boolean), and error…
2.8🔒Q&AQuiz: Chapter 21. What is the difference between let and const in JavaScript/TypeScript? 2. How does Python spell its "nothing" value? How does…
2.9🔒Career Translation- Applied strong typing practices across test automation code using Python type hints and TypeScript annotations, catching variable type…
2.10🔒Q&AInterview Depth CheckPrompt: Why is it important to use const by default and let only when necessary in test automation code? What a strong answer should cover…