import colorama
from colorama import Fore, init

def getJSStringDocs():
    print(Fore.LIGHTMAGENTA_EX +"\nSTRING METHODS - JAVASCRIPT:")
    print(Fore.LIGHTGREEN_EX + "\nstr.charAt(index):")
    print(Fore.WHITE + "\tReturns a new string that has the single code unit at the specified index\n")
    print(Fore.LIGHTGREEN_EX + "str.charCodeAt(index):")
    print(Fore.WHITE + "\tReturns an int between 0 and 65535 representing the char at the index\n")
    print(Fore.LIGHTGREEN_EX + "str.codePointAt(index):")
    print(Fore.WHITE + "\tReturns an int that is the unicode point value at index\n")
    print(Fore.LIGHTGREEN_EX + "str.concat(str2):")
    print(Fore.WHITE + "\tReturns a new string that is the combination of str and str2\n")
    print(Fore.LIGHTGREEN_EX + "str.endsWith(searchString[, length]):")
    print(Fore.WHITE + "\tDetermines whether str ends with the chars in searchString")
    print(Fore.WHITE + "\tlength is optional and is used to specify a different length of str\n")
    print(Fore.LIGHTGREEN_EX + "str.includes(word):")
    print(Fore.WHITE + "\tDetermines whether word is in str and returns True of False accordingly\n")
    print(Fore.LIGHTGREEN_EX + "str.indexOf(searchString):")
    print(Fore.WHITE + "\tReturns the starting index within str of the first occurance of searchString\n")
    print(Fore.LIGHTGREEN_EX + "str.lastIndexOf(searchString):")
    print(Fore.WHITE + "\tReturns the index of the last occurance of searchString within str\n")
    print(Fore.LIGHTGREEN_EX + "str.localeCompare(compareString):")
    print(Fore.WHITE + "\tReturns a number indicating whether a reference string comes before/after/same as given string in sorted order\n")
    print(Fore.LIGHTGREEN_EX + "str.match(regexp):")
    print(Fore.WHITE + "\tReturns the result of matching a string against regexp\n")
    print(Fore.LIGHTGREEN_EX + "str.matchAll(regexp):")
    print(Fore.WHITE + "\tReturns an iterator of all results matching a string against regexp\n")
    print(Fore.LIGHTGREEN_EX + "str.normalize([form]):")
    print(Fore.WHITE + "\tReturns the unicode normalization form of a given string\n")
    print(Fore.LIGHTGREEN_EX + "str.padEnd(targetLength [, padString]):")
    print(Fore.WHITE + "\tPads str with padString until it is the given targetLength\n")
    print(Fore.LIGHTGREEN_EX + "str.padStart(targetLength [, padString]):")
    print(Fore.WHITE + "\tSame as padEnd but puts padString at the start of str not the end\n")
    print(Fore.LIGHTGREEN_EX + "str.repeat(count):")
    print(Fore.WHITE + "\tReturns a new string which contains the specified number of copies of the str\n")
    print(Fore.LIGHTGREEN_EX + "str.replace(regexp|substr, newSubstr|function):")
    print(Fore.WHITE + "\tReturns a new string with all matches of substr replaced with newSubstr\n")
    print(Fore.LIGHTGREEN_EX + "str.search(regexp):")
    print(Fore.WHITE + "\tReturns the index of the match of regexp in str\n")
    print(Fore.LIGHTGREEN_EX + "str.slice(beginIndex [, endIndex]):")
    print(Fore.WHITE + "\tReturns a new string that is a substring of str from beginIndex to endIndex\n")
    print(Fore.LIGHTGREEN_EX + "str.split([separator[, limit]]):")
    print(Fore.WHITE + "\tReturns an array of strings by separating str by separator")
    print(Fore.WHITE + "\tboth separator and limit are optional\n")
    print(Fore.LIGHTGREEN_EX + "str.startsWith(searchString[, position]):")
    print(Fore.WHITE + "\tReturns True if str begins with searchString, False otherwise")
    print(Fore.WHITE + "\tposition is the index to begin searching and it is optional\n")
    print(Fore.LIGHTGREEN_EX + "str.substring(indexStart[, indexEnd]):")
    print(Fore.WHITE + "\tReturns the part of str specified by indexStart and indexEnd(optional)\n")
    print(Fore.LIGHTGREEN_EX + "str.toLocaleLowerCase():")
    print(Fore.WHITE + "\tReturns the calling string value converted to lower case")
    print(Fore.WHITE + "\taccording to locale-specific case mappings\n")
    print(Fore.LIGHTGREEN_EX + "str.toLocaleUpperCase():")
    print(Fore.WHITE + "\tReturns the calling string value converted to upper case")
    print(Fore.WHITE + "\taccording to locale-specific case mappings\n")
    print(Fore.LIGHTGREEN_EX + "str.toLowerCase():")
    print(Fore.WHITE + "\tReturns the calling string value converted to lower case\n")
    print(Fore.LIGHTGREEN_EX + "str.toUpperCase():")
    print(Fore.WHITE + "\tReturns the calling string value converted to upper case\n")
    print(Fore.LIGHTGREEN_EX + "str.trim():")
    print(Fore.WHITE + "\tRemoves whitespace from the start and end of str\n")
    print(Fore.LIGHTGREEN_EX + "str.trimEnd():")
    print(Fore.WHITE + "\tRemoves whitespace just from the end of str\n")
    print(Fore.LIGHTGREEN_EX + "str.trimStart():")
    print(Fore.WHITE + "\tRemoves whitespace just from the start of str\n")
    print(Fore.LIGHTGREEN_EX + "str.valueOf():")
    print(Fore.WHITE + "\tReturns the primitive value of a String object\n")
    print(Fore.LIGHTGREEN_EX + "str.raw():")
    print(Fore.WHITE + "\tReturns the raw string form of template strings\n")

def getJSArrayDocs():
    print(Fore.LIGHTMAGENTA_EX +"\nARRAY METHODS - JAVASCRIPT:")
    print(Fore.LIGHTGREEN_EX + "\narray.concat(arr2):")
    print(Fore.WHITE + "\tReturns a new array which is the concatination of arr and arr2\n")
    print(Fore.LIGHTGREEN_EX + "array.copyWithin(target[, start[, end]]):")
    print(Fore.WHITE + "\tShallow copies part of an array to another location in the same array and returns it\n")
    print(Fore.LIGHTGREEN_EX + "array.entries():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the key/value pairs for each index in the array\n")
    print(Fore.LIGHTGREEN_EX + "array.every(callback[, thisArg]):")
    print(Fore.WHITE + "\tTest whether all elements in the array pass the test implemented by callback\n")
    print(Fore.LIGHTGREEN_EX + "array.fill(value[, start[, end]]):")
    print(Fore.WHITE + "\tFills all the elements of the array with value")
    print(Fore.WHITE + "\tstart and end are optional and can be used to specify a portion of the array to be filled\n")
    print(Fore.LIGHTGREEN_EX + "array.filter(callback(element[, index[, array]])[, thisArg]):")
    print(Fore.WHITE + "\tCreates a new array with all the elements that pass the test implemented by callback\n")
    print(Fore.LIGHTGREEN_EX + "array.find(callback[, thisArg]):")
    print(Fore.WHITE + "\tReturns the value of the first element in the array that satisfies callback")
    print(Fore.WHITE + "\tif no elements satisfy callback undefined is returned\n")
    print(Fore.LIGHTGREEN_EX + "array.findIndex(callback(element[, index[, array]])[, thisArg]):")
    print(Fore.WHITE + "\tReturns the index of the first element in the array that satisfies callback")
    print(Fore.WHITE + "\tif no element satisfies callback -1 is returned\n")
    print(Fore.LIGHTGREEN_EX + "array.flat():")
    print(Fore.WHITE + "\tCreates a new array with all sub-array elements concatenated into it recursively\n")
    print(Fore.LIGHTGREEN_EX + "array.flatMap(function callback(currentValue)):")
    print(Fore.WHITE + "\tMaps each element using a mapping function, the flattens the result into a new array\n")
    print(Fore.LIGHTGREEN_EX + "array.forEach(function callback(currentValue)):")
    print(Fore.WHITE + "\tExecutes callback on each element of the array\n")
    print(Fore.LIGHTGREEN_EX + "array.includes(value[, fromIndex]):")
    print(Fore.WHITE + "\tDetermines whether an array includes a certain value, returns a boolean\n")
    print(Fore.LIGHTGREEN_EX + "array.indexOf(value[, fromIndex]):")
    print(Fore.WHITE + "\tReturns the first index at which value can be found\n")
    print(Fore.LIGHTGREEN_EX + "array.join([separator]):")
    print(Fore.WHITE + "\tReturns a new string by concatenating all of the elements in an array that are")
    print(Fore.WHITE + "\tseparated by commas or a specified separator string\n")
    print(Fore.LIGHTGREEN_EX + "array.keys():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the keys for each index in the array\n")
    print(Fore.LIGHTGREEN_EX + "array.lastIndexOf(searchElement[ , fromIndex]):")
    print(Fore.WHITE + "\tReturns the last index at which searchElement exists in the array\n")
    print(Fore.LIGHTGREEN_EX + "array.map(function callback(currentValue)):")
    print(Fore.WHITE + "\tCreates a new array with the results of calling a provided function on every element\n")
    print(Fore.LIGHTGREEN_EX + "array.pop():")
    print(Fore.WHITE + "\tRemoves the last element from the array and returns it\n")
    print(Fore.LIGHTGREEN_EX + "array.push(element):")
    print(Fore.WHITE + "\tAdds element to the end of the array and returns the new length of the array\n")
    print(Fore.LIGHTGREEN_EX + "array.reduce(callback[, initialValue]):")
    print(Fore.WHITE + "\tExecutes callback on each member of the array resulting in a single output value\n")
    print(Fore.LIGHTGREEN_EX + "array.reduceRight(callback[, initialValue]):")
    print(Fore.WHITE + "\tApplies a function against an accumulator and each value of the array to reduce it to a single value\n")
    print(Fore.LIGHTGREEN_EX + "array.reverse():")
    print(Fore.WHITE + "\tReverses the array in place\n")
    print(Fore.LIGHTGREEN_EX + "array.shift():")
    print(Fore.WHITE + "\tRemoves the first element in the array and returns it\n")
    print(Fore.LIGHTGREEN_EX + "array.slice(begin[, end]):")
    print(Fore.WHITE + "\tReturns a shallow copy of a portion of an array into a new array object from begin to end(not included)\n")
    print(Fore.LIGHTGREEN_EX + "array.some(callback(element)):")
    print(Fore.WHITE + "\tTest whether at least one element in the array passes the test implemented by callback\n")
    print(Fore.LIGHTGREEN_EX + "array.sort([compareFunction]):")
    print(Fore.WHITE + "\tSorts the array in place and returns the array\n")
    print(Fore.LIGHTGREEN_EX + "array.splice(start[, deleteCount]):")
    print(Fore.WHITE + "\tChanges the contents of an array by removing or replacing existing elements and/or adding new elements\n")
    print(Fore.LIGHTGREEN_EX + "array.toLocaleString([locales[, options]]):")
    print(Fore.WHITE + "\tReturns a string representing the elements of the array\n")
    print(Fore.LIGHTGREEN_EX + "array.toString():")
    print(Fore.WHITE + "\tReturns a string representing the specified array and its elements\n")
    print(Fore.LIGHTGREEN_EX + "array.unshift(element):")
    print(Fore.WHITE + "\tAdds element to the start of the array and returns its new length\n")
    print(Fore.LIGHTGREEN_EX + "array.values():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the values for each index in the array\n")

def getJSMapDocs():
    print(Fore.LIGHTMAGENTA_EX +"\nMAP METHODS - JAVASCRIPT:")
    print(Fore.LIGHTGREEN_EX + "\nmap.clear():")
    print(Fore.WHITE + "\tRemoves all elements from map\n")
    print(Fore.LIGHTGREEN_EX + "map.delete(key):")
    print(Fore.WHITE + "\tRemoves the specified element from map\n")
    print(Fore.LIGHTGREEN_EX + "map.entries():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the [key,value] pairs in map\n")
    print(Fore.LIGHTGREEN_EX + "map.forEach(callback[, thisArg]):")
    print(Fore.WHITE + "\tExecutes callback once per each key/value pair in map\n")
    print(Fore.LIGHTGREEN_EX + "map.get(key):")
    print(Fore.WHITE + "\tReturns a specified element from map\n")
    print(Fore.LIGHTGREEN_EX + "map.has(key):")
    print(Fore.WHITE + "\tReturns True if the map has the specified key, False otherwise\n")
    print(Fore.LIGHTGREEN_EX + "map.keys():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the keys for each element in map\n")
    print(Fore.LIGHTGREEN_EX + "map.set(key, value):")
    print(Fore.WHITE + "\tAdds or Updates an element with the specified key and value in map\n")
    print(Fore.LIGHTGREEN_EX + "map.values():")
    print(Fore.WHITE + "\tReturns an iterator object that contains the values for each element in map\n")