{ "name": "Basic JavaScript", "order": 0.006, "challenges": [ { "_id": "bd7123c9c441eddfaeb5bdef", "name": "Meet Booleans", "dashedNname": "waypoint-meet-booleans", "difficulty": "9.98", "description": [ "Return true", "Some additional directions" ], "tests": [ "expect(welcomeToBooleans()).to.be.a(\"boolean\");", "expect(welcomeToBooleans()).to.be.true;" ], "challengeSeed": [ "function welcomeToBooleans() {", "// Good luck!", "return false;", "}", "", "welcomeToBooleans();" ], "challengeType": 1 }, { "_id": "bd7123c9c442eddfaeb5bdef", "name": "Define Your Name", "difficulty": "9.9801", "description": [ "Set the value of myName to your name by typing your name in quotes.", "Currently myName is empty. Type in your name and hit the submit button.", "Look at the ourName example if you get stuck." ], "tests": [ "expect(myName).to.be.a(\"string\");", "expect(myName).length.not.to.be(0);" ], "challengeSeed": [ "// ourName = \"Free Code Camp\";", "myName = \"\";" ], "challengeType": 1 }, { "_id": "bd7123c9c443eddfaeb5bdef", "name": "Start Using Variables", "difficulty": "9.9802", "description": [ "Now, use the var keyword to create a variable called myName. Set its value to your name.", "Variables are used to store values.", "Be sure to use lowercase and uppercase letters properly. JavaScript variables are written in camel case. An example of camel case is: camelCase.", "Look at the ourName example if you get stuck." ], "tests": [ "expect(myName).to.be.a(\"string\");", "expect(myName).length.not.to.be(0);" ], "challengeSeed": [ "// var ourName = \"Free Code Camp\";", "" ], "challengeType": 1 }, { "_id": "bd7123c9c444eddfaeb5bdef", "name": "Define Your First and Last Name", "difficulty": "9.9803", "description": [ "Now, use the var keyword to create a variable called myFirstName and set its value to your first name. Then set a variable called myLastName to your last name.", "Variables are used to store values.", "Be sure to use lowercase and uppercase letters properly. JavaScript variables are written in lower camel case. An example of lower camel case is: lowerCamelCase.", "Look at the ourFirstName and ourLastName examples if you get stuck." ], "tests": [ "expect(myFirstName).to.be.a(\"string\");", "expect(myFirstName).length.not.to.be(0);", "expect(myLastName).to.be.a(\"string\");", "expect(myLastName).length.not.to.be(0);" ], "challengeSeed": [ "// var ourFirstName = \"Free\";", "// var ourLastName = \"Code Camp\";", "", "" ], "challengeType": 1 }, { "_id": "bd7123c9c445eddfaeb5bdef", "name": "Combine Two Strings into One String", "difficulty": "9.9804", "description": [ "Make a variable called myName by adding the string of your first name to the string of your last name.", "Strings can be combined in a process called concatenation.", "Be sure to include a space at the end of your first string. Otherwise the two strings will not have a space between them.", "Be sure to use lowercase and uppercase letters properly. JavaScript variables are written in lower camel case. An example of lower camel case is: lowerCamelCase.", "Look at the ourName example if you get stuck." ], "tests": [ "expect(myName).to.be.a(\"string\");", "expect(myName).length.not.to.be(0);", "expect((/\\s+/).test(myName)).to.be.true;" ], "challengeSeed": [ "// var ourName = \"Free \" + \"Code Camp\";", "", "" ], "challengeType": 1 }, { "_id": "bd7123c9c446eddfaeb5bdef", "name": "Combine Two Variables into One Variable", "difficulty": "9.9805", "description": [ "Make the variables myFirstName, myLastName, and myFullName. Concatenate my myFirstName to myLastName to create myFullName.", "Strings can be combined in a process called concatenation.", "Be sure to include a space at the end of myFirstName. Otherwise myFullName will not contain a space between your first and last names.", "Be sure to use lowercase and uppercase letters properly. JavaScript variables are written in lower camel case. An example of lower camel case is: lowerCamelCase.", "Look at the ourFullName example if you get stuck." ], "tests": [ "expect(myFirstName).to.be.a(\"string\");", "expect(myLastName).to.be.a(\"string\");", "expect(myFullName).to.be.a(\"string\");", "expect(myFullName).length.not.to.be(0);", "expect((/\\s+/).test(myFullName)).to.be.true;" ], "challengeSeed": [ "// var ourFirstName = \"Free \";", "// var ourLastName = \"Code Camp\";", "// var ourFullName = ourFirstName + ourLastName;", "" ], "challengeType": 1 }, { "_id": "bd7123c9c447eddfaeb5bdef", "name": "Concatenate Both Variables and Strings into the Same Variable", "difficulty": "9.9806", "description": [ "Make the variables myFirstName, myLastName, and myFullName. Concatenate my myFirstName to myLastName to create myFullName, but this time add the space as a separate string, not as part of myFirstName or myLastName.", "Strings can be combined in a process called concatenation.", "Be sure to use lowercase and uppercase letters properly. JavaScript variables are written in lower camel case. An example of lower camel case is: lowerCamelCase.", "Look at the ourFullName example if you get stuck." ], "tests": [ "expect(myFirstName).to.be.a(\"string\");", "expect(myLastName).to.be.a(\"string\");", "expect(myFullName).to.be.a(\"string\");", "expect(myFullName).length.not.to.be(0);", "expect((/\\s+/).test(myFullName)).to.be.true;" ], "challengeSeed": [ "// var ourFirstName = \"Free\";", "// var ourLastName = \"Code Camp\";", "// var ourFullName = ourFirstName + \" \" + ourLastName;", "" ], "challengeType": 1 }, { "_id": "bd7123c9c448eddfaeb5bdef", "name": "Check the Length Property of a String Variable", "difficulty": "9.9809", "description": [ "Use the .length property to count the number of characters in the lastNameLength variable.", "For example, if we created a variable var firstName = \"Julie\", we could find out how long the string \"Julie\" is by using the firstName.length property." ], "tests": [ "expect(lastNameLength).to.equal(4);" ], "challengeSeed": [ "var firstName = \"Madeline\";", "", "var firstNameLength = firstName.length;", "", "var lastName = \"Chen\";", "", "var lastNameLength = lastName;", "", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", "function returnValue(lastNameLength) {", " return lastNameLength;", "}", "returnValue(lastNameLength);" ], "challengeType": 1 }, { "_id": "bd7123c9c549eddfaeb5bdef", "name": "Use Bracket Notation to Find the First Character in a String", "difficulty": "9.9810", "description": [ "Use bracket notation to find the first character in a the firstLetterOfLastName variable.", "Bracket notation is a way to get a character at a specific index within a string.", "Computers don't start counting at 1 like humans do. They start at 0.", "For example, the character at index 0 in the word \"Julie\" is \"J\". So if var firstName = \"Julie\", you can get the value of the first letter of the string by using firstName[0].", "Try looking at the firstLetterOfFirstName variable declaration if you get stuck." ], "tests": [ "expect(firstLetterOfLastName).to.equal('C');" ], "challengeSeed": [ "var firstName = \"Madeline\";", "", "var firstLetterOfFirstName = firstName[0];", "", "var lastName = \"Chen\";", "", "var firstLetterOfLastName = lastName;", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", "function returnValue(firstLetterOfLastName) {", " return firstLetterOfLastName;", "}", "returnValue(firstLetterOfLastName);" ], "challengeType": 1 }, { "_id": "bd7123c9c450eddfaeb5bdef", "name": "Use Bracket Notation to Find the Nth Character in a String", "difficulty": "9.9811", "description": [ "Use bracket notation to find the 3rd character in the lastName variable.", "Bracket notation is a way to get a character at a specific index within a string.", "Computers don't start counting at 1 like humans do. They start at 0.", "For example, the character at index 0 in the word \"Julie\" is \"J\". So if var firstName = \"Julie\", you can get the value of the first letter of the string by using firstName[0].", "Try looking at the secondLetterOfFirstName variable declaration if you get stuck." ], "tests": [ "expect(thirdLetterOfLastName).to.equal('e');" ], "challengeSeed": [ "var firstName = \"Madeline\";", "", "var secondLetterOfFirstName = firstName[1];", "", "var lastName = \"Chen\";", "", "var thirdLetterOfLastName = lastName;", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", "function returnValue(thirdLetterOfLastName) {", " return thirdLetterOfLastName;", "}", "returnValue(thirdLetterOfLastName);" ], "challengeType": 1 }, { "_id": "bd7123c9c451eddfaeb5bdef", "name": "Use Bracket Notation to Find the Last Character in a String", "difficulty": "9.9812", "description": [ "Use bracket notation to find the last character in the lastName variable.", "For example, the character at index 0 in the word \"Julie\" is \"J\". So if var firstName = \"Julie\", you can get the value of the first letter of the string by using firstName[0].", "In order to get the last letter of a string, you can subtract one from the string's length.", "For example, if var firstName = \"Julie\", you can get the value of the last letter of the string by using firstName[firstName.length - 1].", "Try looking at the lastLetterOfLastName variable declaration if you get stuck." ], "tests": [ "expect(lastLetterOfLastName).to.equal('n');" ], "challengeSeed": [ "var firstName = \"Madeline\";", "", "var lastLetterOfFirstName = firstName[firstName.length - 1];", "", "var lastName = \"Chen\";", "", "var lastLetterOfLastName = lastName;", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", "function returnValue(lastLetterOfLastName) {", " return lastLetterOfLastName;", "}", "returnValue(lastLetterOfLastName);" ], "challengeType": 1 }, { "_id": "bd7123c9c452eddfaeb5bdef", "name": "Use Bracket Notation to Find the Nth to Last Character in a String", "difficulty": "9.9813", "description": [ "Use bracket notation to find the second-to-last character in the lastName variable.", "For example, the character at index 0 in the word \"Julie\" is \"J\". So if var firstName = \"Julie\", you can get the value of the first letter of the string by using firstName[0].", "In order to get the last letter of a string, you can subtract one from the string's length.", "For example, if var firstName = \"Julie\", you can get the value of the third-to-last letter of the string by using firstName[firstName.length - 3].", "Try looking at the lastLetterOfLastName variable declaration if you get stuck." ], "tests": [ "expect(secondToLastLetterOfLastName).to.equal('e');" ], "challengeSeed": [ "var firstName = \"Madeline\";", "", "var thirdToLastLetterOfFirstName = firstName[firstName.length - 2];", "", "var lastName = \"Chen\";", "", "var secondToLastLetterOfLastName = lastName;", "", "", "// You can ignore this.", "// We use this to show you the value of your variable in your output box.", "// We'll learn about functions soon.", "function returnValue(secondToLastLetterOfLastName) {", " return secondToLastLetterOfLastName;", "}", "returnValue(secondToLastLetterOfLastName);" ], "challengeType": 1 } ] }