Guest User

Untitled

a guest
Feb 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 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 wisePerson(wiseType, whatToSay) {
  12. return 'A wise ' +
  13. wiseType + ' once said: "' + whatToSay + '".';
  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. // tests
  27.  
  28. function testWisePerson() {
  29. var wiseType = 'goat';
  30. var whatToSay = 'hello world';
  31. var expected = 'A wise ' + wiseType + ' once said: "' +
  32. whatToSay + '".';
  33. var actual = wisePerson(wiseType, whatToSay);
  34. if (expected === actual) {
  35. console.log('SUCCESS: `wisePerson` is working');
  36. }
  37. else {
  38. console.log('FAILURE: `wisePerson` is not working');
  39. }
  40. }
  41.  
  42. testWisePerson();
  43. </script>
  44.  
  45.  
  46.  
  47. <script id="jsbin-source-javascript" type="text/javascript">function wisePerson(wiseType, whatToSay) {
  48. return 'A wise ' +
  49. wiseType + ' once said: "' + whatToSay + '".';
  50. }
  51.  
  52.  
  53. /* From here down, you are not expected to
  54. understand.... for now :)
  55.  
  56.  
  57. Nothing to see here!
  58.  
  59. */
  60.  
  61.  
  62. // tests
  63.  
  64. function testWisePerson() {
  65. var wiseType = 'goat';
  66. var whatToSay = 'hello world';
  67. var expected = 'A wise ' + wiseType + ' once said: "' +
  68. whatToSay + '".';
  69. var actual = wisePerson(wiseType, whatToSay);
  70. if (expected === actual) {
  71. console.log('SUCCESS: `wisePerson` is working');
  72. }
  73. else {
  74. console.log('FAILURE: `wisePerson` is not working');
  75. }
  76. }
  77.  
  78. testWisePerson();</script></body>
  79. </html>
Add Comment
Please, Sign In to add comment