Help 24


#1

// To create a variable, we use only one equals sign
// But to check if two values are equal, we use 3 equal signs.

// declare your variable here:

{
console.log(myAge);
}

var varName = data ;

var myName = "Leng" ;

var myAge = 14;

var isOdd = true;

var variableName = 14 ;

What is wrong ??????


#2

Here is a little mistake:
var varName = data ;

data is a variable and you didnt declare data.


#3
{
console.log(myAge);
}

The code block is not needed so we can remove the { and }. The output for this line will be undefined since the variable is not defined until further down the source listing.

var varName = data ;

Already pointed out as ReferenceError: data is undefined

var myName = "Leng" ;

var myAge = 14;

var isOdd = true;

var variableName = 14 ;

These lines look okay.


#4

var variable name is wrong, use myAge


#5

how can I declare data?


#6

Data can take any of the data types that JavaScript recognizes. It cannot exist in a vacuum, though, so must be assigned to some reference to remain in memory.

var aNumber = 42;
var aString = "This is a string primitive.";
var aBoolean = true;
var aNull = null;
var anObject = {};
var anArray = [];

Each of the above lines declare a variable and assign a data value or object.


#10