DabScript
Essentials

Challenge 1

A challenge about declaring and assigning variables in JavaScript.

#1

In the dev tools console, figure out how to do the following:

#2

There are three things wrong with this code. Find them and explain why they are wrong.

const some Number = 20;

someNumber = 50

#3

What does resultVariable equal? What data type is it?

We haven't covered everything here in detail yet, but research this and try to figure it out.
const variable1 = 20;
const variable2 = '40';

const resultVariable = variable1 + variable2;

console.log(resultVariable);

#4

Why is this code invalid? Edit this until it's valid.

const objectVariable = {
  property1: 'i am property 1';
  property2: 'i am property 2';
  property3: [20, 30, 40];
};

console.log(objectVariable.property3[2])

#5

Why does this code not work? Edit until it works.

const myArray = [20, 30, 40];

console.log(myArray[3]);

© 2026 DabAZ.