Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function wisePerson(wiseType, whatToSay) {
  2. return `A wise ${wiseType} once said: "${whatToSay}".`;
  3. }
  4.  
  5. MY ANSWER
  6. function shouter(whatToShout) {
  7. return whatToShout.toUpperCase() + !!!;
  8.  
  9. }
  10.  
  11. REAL ANSWER
  12. function shouter(whatToShout) {
  13. return `${whatToShout.toUpperCase()}!!!`;
  14. }
  15. (didn't put the ticks around)
  16.  
  17.  
  18. MY ANSWER
  19. function textNormalizer(text) {
  20. return text.toLowerCase().slice(0, text.length - 1)
  21. }
  22.  
  23. textNormalizer(" let's GO SURFING NOW everyone is learning how “)
  24.  
  25.  
  26.  
  27. REAL ANSWER
  28. function textNormalizer(text) {
  29. // chaining together method calls like this is called
  30. // *method chaining*
  31. return text.toLowerCase().trim();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement