how could I display the if - else sentence, so that it would really work? thanks in advance
var data = d3.selectAll('.values_half_before').nodes();
var pie = d3.pie() //we create this variable, for the values to be readeable in the console
.value(function(d) {
return d.innerHTML;
})(data);
console.log('pie', pie)
if (pie = ['0', '0', '0']) {
console.log('it is a null vector');
} else {
console.log('it is not a null vector');
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<div class="values_half_before">1</div>
<div class="values_half_before">0</div>
<div class="values_half_before">0</div>
Important: I would like to the script to work by changing the if - else statement, not the upper part.
Thanks a lot