Advertisement
Guest User

Untitled

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