一个Simpli5对象和jQuery对象非常类似,也是一个元素数组,调用对象的方法实际上会调用这些元素的方法,例如,document.body.addClass('myclass')和$('div').addClass('myclass')实际上是将这个类加入到元素中去。
So document.body.addClass('myclass') and $('div').addClass('myclass') both add to the class of the elements.
jQuery对象类似于数组,但是它附带有大量特殊的jQuery函数。
A jQuery object is something like an array but comes with a ton of special jQuery functions.
这个特性与新的对象创建语法关系密切,新的语法可以用类似数组的语法很容易地在 Groovy 中创建 非定制类。
This feature goes hand-in-hand with a new syntax for object creation, which makes it easy to create non-custom classes in Groovy with an array-like syntax.
应用推荐