If I pass an empty array to jade, how can I know if is empty?
Javascript:
var data = [];
Jade:
if(data)
table ...
else
table ...
you can use javascript to check the length of the array.
if (data.length==0){
// do something array is empty
}
here is a related answer https://stackoverflow.com/a/5071150/3556874