/js_refresher

Primary LanguageJavaScript

#Javascript Refresher

#####Questions


  1. selectElementsStartingWithE: return elements from an array starting with the letter E
  2. selectElementsStartingWithVowel: return elements from an array starting with a vowel
  3. removeNullsFromArray: remove null elements and return array
  4. removeNullsAndFalseFromArray: remove null and false elements and return array
  5. reverseEveryElementInArray: return array with each individual string element reversed
  6. dropFirstThreeElements: return array with first three elements removed
  7. addElementToBeginningOfArray: add element to beginning of an array
  8. sortArrayByLastLetterOfEachWord: return array sorted by last letter of each string element
  9. returnFirstHalfOfString: return first half of a string
  10. makeNumberNegative: convert positive (or negative) number to a negative number
  11. separateArrayIntoEvenAndOddNumbers: return nested array with one array of even numbers, one array of odd numbers
  12. numberOfElementsThatArePalindromes: return number of elements in an array that are palindromes
  13. shortestWordInArray: return shortest string in an array
  14. longestWordInArray: return longest string in an array
  15. arrayTotal: return total of number elements in an array
  16. doubleArray: return duplicate of array within a single array and NOT sorted
  17. averageOfArray: return average of number elements within an array
  18. removeElementsGreaterThanFive: return array with elements less than or equal to 5
  19. convertArrayToObject: convert an array into an object with index as the key
  20. getLettersInArrayOfWords: return array with letters of all words sorted in alphabetical order
  21. swapKeysAndValuesInObject: return an object with key and values switched
  22. addKeysAndValues: return sum of numerical keys and values in object
  23. removeCapitalLettersFromString: return string with all capital letters removed
  24. everyPossiblePairing: return multidimensional array with every possible pairing and no duplicates
  25. roundUpNumber: round all decimal numbers up to the next whole number
  26. roundDownNumber: round all decimal numbers down to the previous whole number
  27. formatDateNicely: format date in a user-friendly format
  28. getDomainNameFromEmailAddress: return domain name of email address without @ or .com
  29. titleizeString: return string with first letter of each word capitalised, except for certain words (and, in, the, of, a, an, to)
  30. checkStringForSpecialCharacters: return true or false if string contains non-alphanumerical characters
  31. getUpperLimitOfRange: return max value of pre-determined range of numbers
  32. squareRootOf: return the square root of a given number
  33. callMethodFromString: allows user to call a method using the method name converted to a string
  34. isA2015BankHoliday: returns true if a date is a 2015 Bank holiday
  35. convertToRomanNumerals: returns number from 0 to 99 in roman numeral format