level 1
You've read the guide, now test your knowledge of Variables and types! If you have any doubt, you can go back to the guide.
Question 1
Which variable has the type string?
1const color = 'red';
2const age = 29;
Select...
Question 2
How to get this sentence? «I have spent $30 today.»
1const beginning = 'I have spent';
2const money = 30;
3const end = 'today.';
1
javascript
1console.log(beginning + money + end);
2
javascript
1console.log(beginning + ' $' + money + ' ' + end);
Select...
Question 3
How to display «105»?
1console.log('10' + 5);
2console.log('ten' + 5);
Select...
Question 4
What is the scope of the doors variable?
1const doors = 5;
2
3function getDoors() {
4 console.log(doors);
5}
6
7console.log(getDoors());
Select...
Question 5
What is the value of the variable flower?
1let flower = 'red';
2const roses = 2;
3
4flower = roses;
5
6console.log(flower);
Select...
Question 6
What is the type of the variable «bulb»?
1const bulb = 'yellow';
2
3console.log(typeof(bulb));
Select...
Question 7
How to improve the name of this variable?
1const open = true;
1
javascript
1const isOpen = true;
2
javascript
1setOpen = true;
Select...