Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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 computeArea(width, height) {
- return width * height;
- }
- computeArea(2, 2);
- /* From here down, you are not expected to
- understand.... for now :)
- Nothing to see here!
- */
- // tests
- function testComputeArea() {
- var width = 3;
- var height = 4;
- var expected = 12;
- if (computeArea(width, height) === expected) {
- console.log('SUCCESS: `computeArea` is working');
- }
- else {
- console.log('FAILURE: `computeArea` is not working');
- }
- }
- testComputeArea();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">function computeArea(width, height) {
- return width * height;
- }
- computeArea(2, 2);
- /* From here down, you are not expected to
- understand.... for now :)
- Nothing to see here!
- */
- // tests
- function testComputeArea() {
- var width = 3;
- var height = 4;
- var expected = 12;
- if (computeArea(width, height) === expected) {
- console.log('SUCCESS: `computeArea` is working');
- }
- else {
- console.log('FAILURE: `computeArea` is not working');
- }
- }
- testComputeArea();</script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement