I am working on a part of the code where I have an array which looks like [[data]]
. The data
is rendered on the server side through the Django template engine. So my code looks like this:
var data = {{ series|safe }};
// data will be [[]] if no data is present
if (data ==[[]])
console.log('no data');
The if
always returns false
. That means in [[]] == [[]]
is false
and my test shows that []==[]
is false
as well.
Any descriptions would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…