* fix(curriculum): tests quotes * fix(curriculum): fill seed-teardown * fix(curriculum): fix tests and remove unneeded seed-teardown
1.8 KiB
1.8 KiB
id, title, challengeType
id | title | challengeType |
---|---|---|
bd7123c9c444eddfaeb5bdef | Declare String Variables | 1 |
Description
var myName = "your name";
"your name"
is called a string literal. It is a string because it is a series of zero or more characters enclosed in single or double quotes.
Instructions
string
variables: myFirstName
and myLastName
and assign them the values of your first and last name, respectively.
Tests
tests:
- text: <code>myFirstName</code> should be a string with at least one character in it.
testString: assert((function(){if(typeof myFirstName !== "undefined" && typeof myFirstName === "string" && myFirstName.length > 0){return true;}else{return false;}})(), '<code>myFirstName</code> should be a string with at least one character in it.');
- text: <code>myLastName</code> should be a string with at least one character in it.
testString: assert((function(){if(typeof myLastName !== "undefined" && typeof myLastName === "string" && myLastName.length > 0){return true;}else{return false;}})(), '<code>myLastName</code> should be a string with at least one character in it.');
Challenge Seed
// Example
var firstName = "Alan";
var lastName = "Turing";
// Only change code below this line
After Test
if(typeof myFirstName !== "undefined" && typeof myLastName !== "undefined"){(function(){return myFirstName + ', ' + myLastName;})();}
Solution
var myFirstName = "Alan";
var myLastName = "Turing";