Created
December 13, 2015 19:09
-
-
Save anonymous/dac7e7473d88907f7618 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/sizoqe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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