Skip to content

Instantly share code, notes, and snippets.

Created December 15, 2016 00:44
Show Gist options
  • Save anonymous/fce3e871b2cad4c3f98741cf6a4cf76d to your computer and use it in GitHub Desktop.
Save anonymous/fce3e871b2cad4c3f98741cf6a4cf76d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/mukeyi
<!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 todaysSpecials(special1, special2, special3) {
return [special1, special2, special3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testTodaysSpecials() {
var specials = ["prime rib", "fried goat cheese salad", "fish tacos"]
var result = todaysSpecials(specials[0], specials[1], specials[2]);
if (
specials.length === result.length &&
specials.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `todaysSpecial` works!');
} else {
console.error('FAILURE: `todaysSpecial` is not working');
}
}
testTodaysSpecials();
</script>
<script id="jsbin-source-javascript" type="text/javascript">function todaysSpecials(special1, special2, special3) {
return [special1, special2, special3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testTodaysSpecials() {
var specials = ["prime rib", "fried goat cheese salad", "fish tacos"]
var result = todaysSpecials(specials[0], specials[1], specials[2]);
if (
specials.length === result.length &&
specials.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `todaysSpecial` works!');
} else {
console.error('FAILURE: `todaysSpecial` is not working');
}
}
testTodaysSpecials();
</script></body>
</html>
function todaysSpecials(special1, special2, special3) {
return [special1, special2, special3];
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testTodaysSpecials() {
var specials = ["prime rib", "fried goat cheese salad", "fish tacos"]
var result = todaysSpecials(specials[0], specials[1], specials[2]);
if (
specials.length === result.length &&
specials.every(function(item) {
return result.indexOf(item) > -1;
})) {
console.log('SUCCESS: `todaysSpecial` works!');
} else {
console.error('FAILURE: `todaysSpecial` is not working');
}
}
testTodaysSpecials();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment