For example, for the input GCG, return [["G", "C"], ["C","G"],["G", "C"]]
[["G", "C"], ["G", "C"]]
var arr = [,];this code here assumes two values in the string.
destroyer([1, 2, 3, 1, 2, 3], 3, 2);- the array is the first argument
[1, 2, 3, 1, 2, 3], and the 3 and 2 are the additional arguments. They have provided a link for the
argumentsobject - you use that to access all of the function arguments, and in this case, you want to use it to get the arguments that follow the initial array. The problem statement says:
Remove all elements from the initial array that are of the same value as these arguments.So you find any arguments in the initial array that are contained in the list of the arguments that follow the initial array and remove them, return an array that has any remaining arguments. For the example that I put above, you would remove any
3from the initial array, and return
[1, 1]You have to be able to handle any number of additional arguments, so this one has two, some have three, but you can write code that will handle any number of arguments, so don't just hard code 2 and 3 as the count of values.