Guest User

Untitled

a guest
Feb 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. function computeArea(width, height) {
  12. return width * height
  13. }
  14.  
  15.  
  16. /* From here down, you are not expected to
  17. understand.... for now :)
  18.  
  19.  
  20. Nothing to see here!
  21.  
  22. */
  23.  
  24.  
  25.  
  26. // tests
  27.  
  28. function testComputeArea() {
  29. var width = 3;
  30. var height = 4;
  31. var expected = 12;
  32. if (computeArea(width, height) === expected) {
  33. console.log('SUCCESS: `computeArea` is working');
  34. }
  35. else {
  36. console.log('FAILURE: `computeArea` is not working');
  37. }
  38. }
  39.  
  40. testComputeArea();
  41. </script>
  42.  
  43.  
  44.  
  45. <script id="jsbin-source-javascript" type="text/javascript">function computeArea(width, height) {
  46. return width * height
  47. }
  48.  
  49.  
  50. /* From here down, you are not expected to
  51. understand.... for now :)
  52.  
  53.  
  54. Nothing to see here!
  55.  
  56. */
  57.  
  58.  
  59.  
  60. // tests
  61.  
  62. function testComputeArea() {
  63. var width = 3;
  64. var height = 4;
  65. var expected = 12;
  66. if (computeArea(width, height) === expected) {
  67. console.log('SUCCESS: `computeArea` is working');
  68. }
  69. else {
  70. console.log('FAILURE: `computeArea` is not working');
  71. }
  72. }
  73.  
  74. testComputeArea();</script></body>
  75. </html>
Add Comment
Please, Sign In to add comment