Today I got introduced to Arrays in JavaScript. Here is the tutorial that I used:
https://www.learn-js.org/en/Arrays
In the exercise I had to define an array with the following three variables:
- A string which has the value of "What is the meaning of life?"
- A number which has a value of
42 - A boolean which has a value of
true
After much trial and error I found this solution:
var myArray = ["What is the meaning of life?", 42, true];
console.log(myArray[0]);
console.log(myArray[1]);
console.log(myArray[2]);
Tomorrow I will pick up a book "JavaScript for Kids: A Playful Introduction to Programming", 2014 by Nick Morgan which I ordered from Amazon. Thank you for recommending it!