Skip to content

Instantly share code, notes, and snippets.

@Mattteo1220
Created March 7, 2017 15:00
Show Gist options
  • Save Mattteo1220/cd7d263ede6982a867e7786827b62d2a to your computer and use it in GitHub Desktop.
Save Mattteo1220/cd7d263ede6982a867e7786827b62d2a to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/mayegay
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function makeList(item1, item2, item3) {
return makeList = [item1,item2,item3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testMakeList() {
var items = ["prime rib", "fried goat cheese salad", "fish tacos"];
var result = makeList(items[0], items[1], items[2]);
if (
result && result.length && items.length === result.length &&
items.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `makeList` works!');
} else {
console.error('FAILURE: `makeList` is not working');
}
}
testMakeList();
</script>
<script id="jsbin-source-javascript" type="text/javascript">function makeList(item1, item2, item3) {
return makeList = [item1,item2,item3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testMakeList() {
var items = ["prime rib", "fried goat cheese salad", "fish tacos"];
var result = makeList(items[0], items[1], items[2]);
if (
result && result.length && items.length === result.length &&
items.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `makeList` works!');
} else {
console.error('FAILURE: `makeList` is not working');
}
}
testMakeList();</script></body>
</html>
function makeList(item1, item2, item3) {
return makeList = [item1,item2,item3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testMakeList() {
var items = ["prime rib", "fried goat cheese salad", "fish tacos"];
var result = makeList(items[0], items[1], items[2]);
if (
result && result.length && items.length === result.length &&
items.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `makeList` works!');
} else {
console.error('FAILURE: `makeList` is not working');
}
}
testMakeList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment