I am trying to figure out if an array is empty. I tried this and it does not work.
a = []
if a == []
alert "empty"
I know I can check the length of the array but am curious why this does not work.
There is no direct empty check for arrays. You could do something like this though:
a = []
alert("empty") unless a.length