added an isEmpty function that works on arrays and objects
(cherry picked from commit b5920e94a3221bbd8c6146d9839408030eb1922a)