Fix for access array data with indices

This is a buggy challange (#8843)

Updated description in
seed/challenges/01-front-end-development-certification/html5-and-css.json
to instruct "Create second <p> element after the existing <p> element"

fix for access array data with indices

use deep not-equal in first assertion
pull/9076/head
Pasayadaan 2016-06-09 21:59:30 -05:00 committed by robjloranger
parent d0afae8baa
commit e4381b7c9d
2 changed files with 4 additions and 3 deletions

View File

@ -1673,7 +1673,7 @@
"<strong>Example</strong>",
"<blockquote>var array = [1,2,3];<br>array[0]; // equals 1<br>var data = array[1]; // equals 2</blockquote>",
"<h4>Instructions</h4>",
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code>."
"Create a variable called <code>myData</code> and set it to equal the first value of <code>myArray</code> using bracket notation."
],
"challengeSeed": [
"// Example",
@ -1693,7 +1693,8 @@
"var myArray = [1,2,3];\nvar myData = myArray[0];"
],
"tests": [
"assert((function(){if(typeof myArray != 'undefined' && typeof myData != 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');"
"assert((function(){if(typeof myArray !== 'undefined' && typeof myData !== 'undefined' && myArray[0] === myData){return true;}else{return false;}})(), 'message: The variable <code>myData</code> should equal the first value of <code>myArray</code>.');",
"assert((function(){if(code.match(/\\s*=\\s*myArray\\[0\\]/g)){return true;}else{return false;}})(), 'message: The data in variable <code>myArray</code> should be accessed using bracket notation.');"
],
"type": "waypoint",
"challengeType": 1,

View File

@ -713,7 +713,7 @@
"description": [
"Font size is controlled by the <code>font-size</code> CSS property, like this:",
"<blockquote>h1 {<br>&nbsp;&nbsp;font-size: 30px;<br>}</blockquote>",
"Create a second <code>p</code> element with the following kitty ipsum text: <code>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</code>",
"Create a second <code>p</code> element after the existing <code>p</code> element with the following kitty ipsum text: <code>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</code>",
"Inside the same <code>&#60;style&#62;</code> tag that contains your <code>red-text</code> class, create an entry for <code>p</code> elements and set the <code>font-size</code> to 16 pixels (<code>16px</code>).",
"<strong>Note</strong><br>Due to browser implementation differences, you may need to be at 100% zoom to pass the tests on this challenge.",
"Also, please do not add a class attribute to your new <code>p</code> element."