Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="description" content="[Wiseperson Generator]">
  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 wisePerson(wiseType, whatToSay) {
  13.  
  14. return 'A wise ' + wiseType + ' once said: "' +
  15. whatToSay + '".';
  16.  
  17. }
  18.  
  19.  
  20. /* From here down, you are not expected to
  21. understand.... for now :)
  22.  
  23.  
  24. Nothing to see here!
  25.  
  26. */
  27.  
  28.  
  29. // tests
  30.  
  31. function testWisePerson() {
  32. var wiseType = 'goat';
  33. var whatToSay = 'hello world';
  34. var expected = 'A wise ' + wiseType + ' once said: "' +
  35. whatToSay + '".';
  36. var actual = wisePerson(wiseType, whatToSay);
  37. if (expected === actual) {
  38. console.log('SUCCESS: `wisePerson` is working');
  39. }
  40. else {
  41. console.log('FAILURE: `wisePerson` is not working');
  42. }
  43. }
  44.  
  45. testWisePerson();
  46. </script>
  47.  
  48.  
  49.  
  50. <script id="jsbin-source-javascript" type="text/javascript">function wisePerson(wiseType, whatToSay) {
  51.  
  52. return 'A wise ' + wiseType + ' once said: "' +
  53. whatToSay + '".';
  54.  
  55. }
  56.  
  57.  
  58. /* From here down, you are not expected to
  59. understand.... for now :)
  60.  
  61.  
  62. Nothing to see here!
  63.  
  64. */
  65.  
  66.  
  67. // tests
  68.  
  69. function testWisePerson() {
  70. var wiseType = 'goat';
  71. var whatToSay = 'hello world';
  72. var expected = 'A wise ' + wiseType + ' once said: "' +
  73. whatToSay + '".';
  74. var actual = wisePerson(wiseType, whatToSay);
  75. if (expected === actual) {
  76. console.log('SUCCESS: `wisePerson` is working');
  77. }
  78. else {
  79. console.log('FAILURE: `wisePerson` is not working');
  80. }
  81. }
  82.  
  83. testWisePerson();</script></body>
  84. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement