What is a jQuery Object?

后端 未结 2 1173
逝去的感伤
逝去的感伤 2020-12-02 19:17

JavaScript kind of redefines what an Array means because an array is an object with a .length property and methods like .slice() and .join()<

2条回答
  •  一整个雨季
    2020-12-02 20:04

    the jQuery object is an object which has

    • a length property
    • numeric properties which reference the items from the select (0,1,2,3...)
    • bindings to jQuery functions
    • additional jQuery properties

    The length and numeric properties allow the object to respond like an array. You can run it in a for loop or use functions like map or each on it.

    I would recommend using your browser's debugger or Firebug and inspect a jQuery object. That will teach you a lot about how it is structured.

提交回复
热议问题