<!DOCTYPE HTML>
<html>
<body>
<p>Before the script...</p>
<script>
alert([[25,4]].includes([25,4]));
</script>
<p>...After the script.</p>
</body>
</html>
When I run the above code, it outputs "false", which isn't correct. If I change [[25,4]].includes([25,4]) to ['a'].includes('a'), it outputs the correct answer "true". Why does it do that?
includestests for strict equality meaning the two arrays would need to be the same array not two arrays that happen to hold the same values. It doesn't work for the same reason[[25,5]] === [[25,5]]is false.var tuple = [25, 24]; alert([tuple].includes(tuple))there you go