mootools 相当于 jQuery 的 .is()

mootools equivalent of jQuery's .is()

Mootools 是否有等同于 jQuery 的 .is()?或者,如果不是,那么在 Mootools 中实现此功能的最佳方法是什么?我搜索了一段时间,似乎找不到合适的解决方案。

示例 jQuery 我正在尝试在 Mootools 中实现。

if(a.is(':last-child')){
   console.log('this should return true >', a.is(':last-child'));
}

任何帮助都会很棒,谢谢!

好吧,我不知道 Mootools 的等效项,但您可能可以 native matches() function. Other Link

var bd = document.body;
console.log(bd.matches('body')) //true
console.log(bd.matches(':last-child')) //true