Advertisement
Guest User

Untitled

a guest
May 6th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. /**
  2. * This function logs to the console each element in an Array of Strings.
  3. * This function accepts an Array of Strings as an argument and returns nothing.
  4. *
  5. * printArray(['Such', 'Hawks', 'Such', 'Hounds']);
  6. *
  7. * Will display in the console as:
  8. * Such
  9. * Hawks
  10. * Such
  11. * Hounds
  12. */
  13.  
  14.  
  15.  
  16.  
  17. /**
  18. * This function returns the sum of all the digits up to a given Number,
  19. * and accepts a Number as an argument and returns a Number.
  20. *
  21. * sumTotalUntil(19) //-> 190
  22. * sumTotalUntil(200) //-> 20100
  23. */
  24.  
  25.  
  26.  
  27.  
  28. /**
  29. * This function will remove all alphabet characters in a String, leaving only numbers.
  30. * Once all letters are removed, return the string (of Numbers) as an actual
  31. * Number value (do not return it as a String data type).
  32. *
  33. * This function accepts a String as an argument and returns a Number.
  34. *
  35. * parseToNumber("082hufisjdf785klasdju342"); //-> 82785342
  36. */
  37.  
  38.  
  39.  
  40.  
  41. /**
  42. * This function returns the smallest value found in an Array.
  43. * This function takes an Array of Numbers as an argument and returns a Number.
  44. *
  45. * minValue([892,372,67,3,26,2]) //-> 2
  46. */
  47.  
  48.  
  49.  
  50. /**
  51. * This function returns as Array of Strings with a minimal length requirement.
  52. * This function takes an Array of Strings as the first argument and
  53. * also takes a Number as the second argument which servers as the delimiter value.
  54. *
  55. * This function returns an Array of Strings
  56. *
  57. * var dictionary = ["Bush", "Microwave", "Potato Chips", "Doritos", "Par", "Cook"]
  58. *
  59. * normalize(dictionary, 6) //-> [ "Microwave", "Potato Chips", "Doritos" ]
  60. */
  61.  
  62.  
  63. /**
  64. * RECURSION
  65. * "To understand recursion, you must first understand recursion"
  66. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement