Declare String Variables

This commit is contained in:
Abhisek Pattnaik
2015-12-25 03:36:25 +05:30
committed by SaintPeter
parent a9521b2bbd
commit 3338991ed3

View File

@ -827,9 +827,11 @@
"id": "bd7123c9c444eddfaeb5bdef",
"title": "Declare String Variables",
"description": [
"Previously we have used the code <code>var myName = \"your name\"</code>. This is what we call a <code>String</code> variable. It is nothing more than a \"string\" of characters. JavaScript strings are always wrapped in quotes.",
"Previously we have used the code",
"<code>var myName = \"your name\"</code>",
"<code>\"your name\"</code> is called a <dfn>string</dfn> <dfn>literal</dfn>. It is a string because it is a series of zero or more characters enclosed in single or double quotes.",
"<h4>Instructions</h4>",
"Create two new string variables: <code>myFirstName</code> and <code>myLastName</code> and assign them the values of your first and last name, respectively."
"Create two new <code>string</code> variables: <code>myFirstName</code> and <code>myLastName</code> and assign them the values of your first and last name, respectively."
],
"tests": [
"assert((function(){if(typeof(myFirstName) !== \"undefined\" && typeof(myFirstName) === \"string\" && myFirstName.length > 0){return true;}else{return false;}})(), 'message: <code>myFirstName</code> should be a string with at least one character in it.');",