Skip to content

Instantly share code, notes, and snippets.

Created December 13, 2015 19:09
Show Gist options
  • Save anonymous/dac7e7473d88907f7618 to your computer and use it in GitHub Desktop.
Save anonymous/dac7e7473d88907f7618 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/sizoqe
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
"use strict";
var hello = function hello() {
var name = arguments.length <= 0 || arguments[0] === undefined ? "World" : arguments[0];
return "Hello " + name;
};
var testHello = function testHello() {
expect(hello()).toEqual('Hello World');
expect(hello("Esma")).toEqual("Hello Esma");
};
testHello();
console.log("ALl tests passed!");
</script>
<script id="jsbin-source-javascript" type="text/javascript">const hello = (name="World") => `Hello ${name}`;
const testHello = () => {
expect(hello()).toEqual('Hello World');
expect(hello("Esma")).toEqual("Hello Esma")
}
testHello();
console.log("ALl tests passed!");</script></body>
</html>
"use strict";
var hello = function hello() {
var name = arguments.length <= 0 || arguments[0] === undefined ? "World" : arguments[0];
return "Hello " + name;
};
var testHello = function testHello() {
expect(hello()).toEqual('Hello World');
expect(hello("Esma")).toEqual("Hello Esma");
};
testHello();
console.log("ALl tests passed!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment