Start with Python
This commit is contained in:
8
2- javascript/7-simple-loops/README.md
Normal file
8
2- javascript/7-simple-loops/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
Simple Loops and Iteration
|
||||
==========================
|
||||
|
||||
You are given an array (challengeArray) at the top. Using a loop, compare the values inside. If a value in the list is "Dog", switch it to "Burger".
|
||||
|
||||
#### Assertion
|
||||
|
||||
Make sure your results are printing so you know its working- because you're not going to get much from the assert test. Why is that? Google it and write the answer, as well as your own.
|
24
2- javascript/7-simple-loops/simple-loops.js
Normal file
24
2- javascript/7-simple-loops/simple-loops.js
Normal file
@ -0,0 +1,24 @@
|
||||
//Do not edit this list
|
||||
|
||||
var challengeArray = ["New York", "Dog", "Philly", "Dog", "Jersey", "Dog", "Cali", "Dog"];
|
||||
|
||||
// your code goes in this function
|
||||
|
||||
function getDogs(array){
|
||||
|
||||
}
|
||||
|
||||
// call the function
|
||||
|
||||
|
||||
|
||||
// do not edit the assert statements
|
||||
|
||||
function assert(testnum, bool){
|
||||
console.log('Test ' + testnum + ": " + bool)
|
||||
}
|
||||
|
||||
assert(1, challengeArray === ['New York', 'Burger', 'Philly', 'Burger', 'Jersey', 'Burger', 'Cali', 'Burger']);
|
||||
|
||||
//Make sure you have the correct array - is the assert test working? Why not? Google!
|
||||
//Write a custom test that allows it to prove challengeArray's equality.
|
Reference in New Issue
Block a user