Minimum
Write a function min that takes two arguments and returns their minimum.
1 | function min(a,b){ |
Recursion
Define a recursive function isEven corresponding to this description. The function should accept a number parameter and return a Boolean.
1 | function isEven(num){ |
Bean Counting
Write a function countBs that takes a string as its only argument and returns a number that indicates how many uppercase “B” characters are in the string.
Next, write a function called countChar that behaves like countBs, except it takes a second argument that indicates the character that is to be counted (rather than counting only uppercase “B” characters). Rewrite countBs to make use of this new function.
1 | function countBs(str){ |