How can you take in two arrays and compare it then replace one with another.
Example: let say I have 2 arrays: theArray1
, theArray2
.
let theArray1 = ['Sam', 'jessica', 'theStore'];
let theArray2 =['sam', 'Jessica #' , 'TheStore'];
The two arrays look like they are the same, but they're not. let make theArray1
the reference. What is the most efficient way to turn theArray2
into theArray1
so that I can do this:
expect(theArray1).to.be.equalTo(theArray2).
I tried copy another array that take theArray1
as reference, but that is not the problem. The problem is I want to manipulate theArray2
to make it the same as theArray1
.