curriculum/challenges/english/blocks/basic-javascript/bd7123c9c444eddfaeb5bdef.md
Previously you used the following code to declare a variable:
var myName;
But you can also declare a string variable like this:
var myName = "your name";
"your name" is called a <dfn>string</dfn> <dfn>literal</dfn>. A string literal, or string, is a series of zero or more characters enclosed in single or double quotes.
Create two new string variables: myFirstName and myLastName and assign them the values of your first and last name, respectively.
myFirstName should be a string with at least one character in it.
assert(
(function () {
if (
typeof myFirstName !== 'undefined' &&
typeof myFirstName === 'string' &&
myFirstName.length > 0
) {
return true;
} else {
return false;
}
})()
);
myLastName should be a string with at least one character in it.
assert(
(function () {
if (
typeof myLastName !== 'undefined' &&
typeof myLastName === 'string' &&
myLastName.length > 0
) {
return true;
} else {
return false;
}
})()
);
var myFirstName = "Alan";
var myLastName = "Turing";