Skip to content

Commit

Permalink
fix(curriculum): fill seed-teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS committed Oct 19, 2018
1 parent 1adf4b0 commit bbaee17
Show file tree
Hide file tree
Showing 195 changed files with 1,751 additions and 194 deletions.
Expand Up @@ -63,7 +63,8 @@ frankenSplice([1, 2, 3], [4, 5, 6], 1);
<div id='js-teardown'>

```js
console.info('after the test');
let testArr1 = [1, 2];
let testArr2 = ["a", "b"];
```

</div>
Expand Down
Expand Up @@ -75,6 +75,25 @@ console.log(isEveryoneHere(users));
<section id='solution'>

```js
let users = {
Alan: {
age: 27,
online: true
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: true
},
Ryan: {
age: 19,
online: true
}
};

function isEveryoneHere(obj) {
return [
'Alan',
Expand All @@ -83,5 +102,7 @@ function isEveryoneHere(obj) {
'Ryan'
].every(i => obj.hasOwnProperty(i));
}

console.log(isEveryoneHere(users));
```
</section>
Expand Up @@ -72,8 +72,29 @@ console.log(getArrayOfUsers(users));
<section id='solution'>

```js
let users = {
Alan: {
age: 27,
online: false
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: false
},
Ryan: {
age: 19,
online: true
}
};

function getArrayOfUsers(obj) {
return Object.keys(users);
}

console.log(getArrayOfUsers(users));
```
</section>
Expand Up @@ -57,7 +57,7 @@ var myArray = [50,60,70];
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof myArray !== "undefined" && typeof myData !== "undefined"){(function(y,z){return 'myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z);})(myArray, myData);}
```

</div>
Expand Down
Expand Up @@ -53,7 +53,7 @@ var myData = myArray[0][0];
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof myArray !== "undefined"){(function(){return "myData: " + myData + " myArray: " + JSON.stringify(myArray);})();}
```

</div>
Expand Down
Expand Up @@ -70,7 +70,12 @@ var secondTree = ""; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(x) {
if(typeof x != 'undefined') {
return "secondTree = " + x;
}
return "secondTree is undefined";
})(secondTree);
```

</div>
Expand Down
Expand Up @@ -61,7 +61,12 @@ var gloveBoxContents = undefined; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(x) {
if(typeof x != 'undefined') {
return "gloveBoxContents = " + x;
}
return "gloveBoxContents is undefined";
})(gloveBoxContents);
```

</div>
Expand Down
Expand Up @@ -65,7 +65,7 @@ var drinkValue = testObj; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b) { return "entreeValue = '" + a + "', drinkValue = '" + b + "'"; })(entreeValue,drinkValue);
```

</div>
Expand Down
Expand Up @@ -63,7 +63,7 @@ var shirtValue = testObj; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b) { return "hatValue = '" + a + "', shirtValue = '" + b + "'"; })(hatValue,shirtValue);
```

</div>
Expand Down
Expand Up @@ -70,7 +70,7 @@ var player = testObj; // Change this Line
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof player !== "undefined"){(function(v){return v;})(player);}
```

</div>
Expand Down
Expand Up @@ -68,7 +68,7 @@ var myDog = {
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return z;})(myDog);
```

</div>
Expand Down
Expand Up @@ -49,7 +49,7 @@ var sum = 10 + 0;
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return 'sum = '+z;})(sum);
```

</div>
Expand Down
Expand Up @@ -54,7 +54,20 @@ var myStr = "Learning to code is ";
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
var output = [];
if(typeof someAdjective === 'string') {
output.push('someAdjective = "' + someAdjective + '"');
} else {
output.push('someAdjective is not a string');
}
if(typeof myStr === 'string') {
output.push('myStr = "' + myStr + '"');
} else {
output.push('myStr is not a string');
}
return output.join('\n');
})();
```

</div>
Expand Down
Expand Up @@ -66,7 +66,7 @@ function processArg(num) {
<div id='js-teardown'>

```js
console.info('after the test');
(function(){return "processed = " + processed})();
```

</div>
Expand Down
Expand Up @@ -73,7 +73,7 @@ var myDog = {
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return z;})(myDog);
```

</div>
Expand Down
Expand Up @@ -63,7 +63,7 @@ c = c + 7;
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);
```

</div>
Expand Down
Expand Up @@ -62,7 +62,7 @@ c = c / 11;
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);
```

</div>
Expand Down
Expand Up @@ -63,7 +63,7 @@ c = c * 10;
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);
```

</div>
Expand Down
Expand Up @@ -63,7 +63,7 @@ c = c - 1;
<div id='js-teardown'>

```js
console.info('after the test');
(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);
```

</div>
Expand Down
Expand Up @@ -58,7 +58,13 @@ var myStr;
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
if(typeof myStr === 'string') {
return 'myStr = "' + myStr + '"';
} else {
return 'myStr is not a string';
}
})();
```

</div>
Expand Down
Expand Up @@ -53,7 +53,13 @@ var myStr;
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
if(typeof myStr === 'string') {
return 'myStr = "' + myStr + '"';
} else {
return 'myStr is not a string';
}
})();
```

</div>
Expand Down
Expand Up @@ -52,7 +52,20 @@ var myStr;
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
var output = [];
if(typeof myName === 'string') {
output.push('myName = "' + myName + '"');
} else {
output.push('myName is not a string');
}
if(typeof myStr === 'string') {
output.push('myStr = "' + myStr + '"');
} else {
output.push('myStr is not a string');
}
return output.join('\n');
})();
```

</div>
Expand Down
Expand Up @@ -63,7 +63,7 @@ var myArray = [];
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof myArray !== "undefined"){(function(){return myArray;})();}
```

</div>
Expand Down
Expand Up @@ -49,7 +49,7 @@ var ourDecimal = 5.7;
<div id='js-teardown'>

```js
console.info('after the test');
(function(){if(typeof myDecimal !== "undefined"){return myDecimal;}})();
```

</div>
Expand Down
Expand Up @@ -54,7 +54,7 @@ var ourName;
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof myName !== "undefined"){(function(v){return v;})(myName);}
```

</div>
Expand Down
Expand Up @@ -52,7 +52,7 @@ var lastName = "Turing";
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof myFirstName !== "undefined" && typeof myLastName !== "undefined"){(function(){return myFirstName + ', ' + myLastName;})();}
```

</div>
Expand Down
Expand Up @@ -56,7 +56,7 @@ myVar = myVar - 1;
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return 'myVar = ' + z;})(myVar);
```

</div>
Expand Down
Expand Up @@ -67,7 +67,7 @@ var myDog = {
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return z;})(myDog);
```

</div>
Expand Down
Expand Up @@ -48,7 +48,7 @@ var quotient = 0.0 / 2.0; // Fix this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(y){return 'quotient = '+y;})(quotient);
```

</div>
Expand Down
Expand Up @@ -51,7 +51,7 @@ var quotient = 66 / 0;
<div id='js-teardown'>

```js
console.info('after the test');
(function(z){return 'quotient = '+z;})(quotient);
```

</div>
Expand Down
Expand Up @@ -60,7 +60,9 @@ var myStr; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
if (myStr !== undefined){
console.log('myStr:\n' + myStr);}})();
```

</div>
Expand Down
Expand Up @@ -51,7 +51,13 @@ var myStr = ""; // Change this line
<div id='js-teardown'>

```js
console.info('after the test');
(function(){
if(typeof myStr === 'string') {
console.log("myStr = \"" + myStr + "\"");
} else {
console.log("myStr is undefined");
}
})();
```

</div>
Expand Down
Expand Up @@ -60,7 +60,7 @@ lastNameLength = lastName;
<div id='js-teardown'>

```js
console.info('after the test');
if(typeof lastNameLength !== "undefined"){(function(){return lastNameLength;})();}
```

</div>
Expand Down

0 comments on commit bbaee17

Please sign in to comment.