How does a jQuery instance appear as an array when called in console.log?

后端 未结 5 1877
一个人的身影
一个人的身影 2021-01-03 15:58

When entered into a JavaScript console, a jQuery object appears as an array. However, it\'s still an instance of the jQuery object.

var j = jQuery();
=> [         


        
5条回答
  •  抹茶落季
    2021-01-03 16:06

    The console makes it look like an array because it has array-like properties. It has length and n keys using integers.

提交回复
热议问题