Create a Variable II

If variables can hold strings, can they hold other data types? Let's give it a shot:

var myAge = 15;
var likesChocolate = true;

// Output: 15

// Output: true

Variables can hold any data type, like strings, numbers, and Booleans. They can also hold data types that we have not learned yet, like arrays, functions and objects (more on that later).

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.