A
A
AnneyBen2022-01-12 14:03:07
css
AnneyBen, 2022-01-12 14:03:07

Why does == show false and not true?

false == 0;
true

true == 1;
true


var text001 = [true, false, true, false, false];
var text002 = [1, 0, 1, 0, 0];
text001 == text002;
false


Why is this happening?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
Lumore, 2015-10-17
@bozilly

<style>
#content {
float: right;
width: calc(100% - 200px);
}
#sidebar {
float: left;
width: 200px;
}
@media screen and (max-width: 960px) {
#content, #sidebar {
width: 100%;
float: none;
}
}
</style>
<div id="content"></div>
<div id="sidebar"></div>

I
IceJOKER, 2015-10-17
@IceJOKER

<div class='wrapper'>
  <div class='content'>
  </div>
  <div class='sidebar'>
  </div>
</div>

float + width + calc + Media Queries - all you need, 100500 examples on the internet

D
dk-web, 2015-10-17
@dk-web

codepen.io/anon/pen/bdOWze?editors=110
I was once given such a link... I
use it 100 %

R
Rsa97, 2022-01-12
@AnneyBen

Because objects (and an array is also an object) are not compared element by element. References to objects are compared, but they are different, even if the contents of the objects are exactly the same.

1 == 1 // true
[1] == [1] // false

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question