• Write a function that returns a subset of a string between one index and another. function(str, indexStart, indexEnd) Example (abcd',1,10) return 'bcd') Example 2 (abcd',0,1) return 'ab') (similar built-in function substring or substr).
  • Write a function that returns a new string containing all matches. Each match is then replaced by replacement characters, function(str. charToChange, charToReplace) Example (abc', 'a','X') return Xbc
  • Write a function that returns an index of the receiving string for the first occurrence of the specified character. Start the search with the fromIndex parameter. Returns - 1 if the value is not found. function(str,searchChar,fromIndex) (similar built-in function indexof)
  • Write a function which removes whitespace from both ends of the receiving string. Whitespace in this context is all whitespace characters (spaces, tabs, and newlines.) function(" valuelt ") //return "value"
  • Write a function which splits the receiving string parameter into an array of strings by separating the string into substrings and return the array, function (stringToSplit, separator) Example ('albic', T. return ['a','b','c'), (bcAbd, 'A', return [bc', 'bd'), (bacd, 'X' return ['b', 'a','c','d']) (similar built-in function split)
  • The trimRight() method removes whitespace from the right end of a string. Whitespace in this context is all the whitespace characters (spaces, tabs, and newlines.) function(" value\t") //return "value"
  • Write a function to return a unique concatenated array from 2 arrays //function([1,2],[2,4]) //return [1,2,4]', (Note: similar functionality as Array.concat)

Do not use function

You are not allowed to use any of the built-in functions listed in the Do not use function section of this document. Using any of the following functions will result in zero marks for your assignment.

String built-in functions Array built-in functions
endsWith()
includes()
indexOf()
lastIndexOf()
localeCompare()
match()
repeat()
replace()
search()
slice()
split()
startsWith()
substr()
substring()
toLocaleLowerCase()
toLocaleUpperCase()
toLowerCase()
toString()
toUpperCase()
trim()
valueOf()
trimLeft and trimRight
concat()
copyWithin()
every()
fill()
filter()
find()
findeIndex()
forEach()
indexOf()
isArray()
join()
lastIndexOf()
map()
pop()
push()
reduce()
reduceRight()
reverse()
shift()
slice()
some()
sort()
splice()
toString()
unshift()
valueOf()

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.