LogitechCodes
Automated Revenue Engineer
LEVEL 1
300 XP
- Variables allow storing data in webscript programs. They are declared using var, let or const.
- Webscript has different data types like:
- Numbers - integers and floats like 10, 3.14
- Strings - text in quotes like "Hello"
- Booleans - true/false values
- Null - intentional empty value
- Undefined - uninitialized variable
- Objects - complex data structures
- Arrays - ordered collection of values
- Examples declaring variables:
let age = 30; const name = "John"; - Strings can use single or double quotes. Can be concatenated with +.
- Numbers don't need quotes. Can perform math operations.
- Booleans represent logical values. Stored as true or false.
- Null is an empty value that can be assigned.
- Undefined represents variables that have not been set yet.
- Typeof operator can check data type of a variable.
- Variables allow reusing values instead of repeating them.
- Cover type conversions like string to number etc.
- Explain dynamic typing - variables can hold different types of values.