I'm trying to compare indexes of an array. However I'm not to sure I'm going about it correctly. My thoughts are:
let tempArray = [tempInfo1,tempInfo2];
if(tempArray[0] == tempArray[1]){
console.log('true');
}else{
console.log('false');
}
Am I headed in the right direction? Or is this completely off?
Essentially - I'm trying to make a 'matching game'. Clicking an element stores that element in a tempArray (tempInfo1), and clicking on a second element stores a second value in that array (tempInfo2). Then I'm trying to check if the values are the same - do something. If not do something else. Does this help?