why $.isEmptyObject($('#id-does-not-exist-on-page')) returns false?

后端 未结 3 1511
梦谈多话
梦谈多话 2021-01-15 07:45

I\'m little confused by jQuery.isEmptyObject method.

$.isEmptyObject([]) -> returns true

but

$(\'#id-does-not-exist-

3条回答
  •  我在风中等你
    2021-01-15 08:23

    According to the jQuery documentation (isEmptyObject) :

    The argument should always be a plain JavaScript Object as other types of object (DOM elements, primitive strings/numbers, host objects) may not give consistent results across browsers

提交回复
热议问题