(1) Define a function maxOfThree() that takes three numbers as arguments and returns the largest of them.
(2)Define a function reverse() that computes the reversal of a string. For example, reverse("jag testar") should return the string "ratset gaj".
(3)Write a function filterLongWords() that takes an array of words and an integer i and returns the array of words that are longer than i.
(4)Write a function charFreq() that takes a string and builds a frequency listing of the characters contained in it. Represent the frequency listing as a Javascript object. Try it with something like charFreq("abbabcbdbabdbdbabababcbcbab"). Define a Javascript function that encapsulates the above functions.
note:all those program are in javascript.
Comments
Leave a comment