🎯 Exercise 1
Objective: Practice initializing JSON variables and using Console logs to access and display values.
Last updated
Was this helpful?
Objective: Practice initializing JSON variables and using Console logs to access and display values.
1. Initialize a JSON array variable called names: ["Alice", "Bob", "Carol", "David"]
2. Initialize a JSON object variable called user: {"first_name": "John", "last_name": "Doe", "email": "john@example.com"}
3. Add Console steps to print greetings and user information using variable references.
- To access values from a JSON array, use index notation: {{variables.names.0}} for the first item, {{variables.names.1}} for the second, and so on.
- To access values from a JSON object, use the key name: {{variables.user.first_name}}, {{variables.user.last_name}}, etc.
Expected Output:
Hello, Alice!
Hello, Bob!
Hello, Carol!
Hello, David!
John Doe — john@example.com
Last updated
Was this helpful?
Was this helpful?