Can someone help me with this problem.
For further actions, you may consider blocking this person and/or reporting abuse
Can someone help me with this problem.
For further actions, you may consider blocking this person and/or reporting abuse
zhuyue -
Burton Smith -
Jagroop Singh -
Marcos Mendes -
Top comments (1)
Hola,
I helped a mentee with this problem. I was also not very clear on what was required.
The problem involves searching for an array,
[1,2]
, in a search space which is a multidimensional array, e.g[[2,3], [3,4]]
. However, the search space is passed in as part ofthis
value to the function.If we want to bind an object,
[[2,3], [3,4]]
, asthis
to thecontains
function it would becontains.bind([[2,3], [3,4]])
.bind
returns a new function, and that function then callscontains
with the given value asthis
. If you check your test files, you will notice thatbind
is used to pass in the search space/state.So the
contains
function should look something like the following, note howthis
is used in the function:References
this and bind